SRL Archive - Help and Support

FindColourPoints or CountColourPoints


Miitchyy

2007-08-03 04:49:00

Excuse my spelling of Colour its just how I was taught to and I prefer, But anyway,

I'm kinda tired so I cant be stuffed looking but, Is there some way of Counting all the points at which a colour is found without making a custom function to do it?

  FindColorsTolerance(var Points: TPointArray; color, xs, ys, xe, ye: Integer; Tolerance: Integer);
FindColorsSpiralTolerance(x, y: Integer; var Points: TPointArray; color, xs, ys, xe, ye: Integer; Tolerance: Integer);
GetColors(Coords: TPointArray): TIntegerArray;

Yaye, Thanks SB

@n3ss3s;
Nooo, I need the Points where the colours were found at so I can choose the one farthest from the Minimap Centre and closest to the middle X

Starblaster100

2007-08-03 06:32:26

FindColorsSpiralTolerance

i think it was called.

Maybe also try

GetColors

n3ss3s

2007-08-03 06:42:46

Scar has CountColors, couldnt you use that?

Pyro

2007-08-04 05:46:37

kevin ill show you :p star is right. use findcolorstolerance or whatever you want if you want to spiral so…

FindColorsTolerance(var Points: TPointArray; color, xs, ys, xe, ye: Integer; Tolerance: Integer);

the tpointarray is where they are stored to for example…

var
mytpoint:tpointarray;
begin
findcolorstolerance(mytpoiunt etc etc etc

ok then what happens is they are stored in your tpoint like a normal array. IM guessing you know arrays? if not then just head over to tut section and they should be able to help you… but like say it will now be

mypointarray[0].x = this is the x co ord for the first color found

and so on and so forth. You will need to know about getarraylength also.

Miitchyy

2007-08-04 06:12:04

xD Yea, I know my TPoints and Arrays and Types pretty well,
Thanks anyway though

Pyro

2007-08-04 08:37:16

Right so got it? really all you would need is to count the colors is to use getarraylength on the tpoint and then whatever.

Wanted

2007-08-04 12:28:30

You're over complicating it, just use

Originally by SCAR CDE Manual Divi 3.11.
function CountColor(Color, x1, y1, x2, y2: Integer): Integer;
Counts the instances found of Color in the area specified by x1, y1, x2 and y2.


An Example:

AmountOfPoints := CountColor(123456, MMX1, MMY1, MMX2, MMY2);

Boreas

2007-08-04 12:57:52

Read the thread. He needs the tpoints too.

Pyro

2007-08-04 18:23:08

Yip yip boreas is correct. He needs where those colors are found aswell as the amount of times found. For this you need to use findcolors.

Miitchyy

2007-08-05 01:49:11

lol Thanks guys, I didnt even end up using this method in the end XD.
Although I'll probly need to since theres a bug that happens sometimes D: