SRL Archive - Help

searching multiple specific colours


zluo

2012-06-22 00:28:43

what can search multiple specific colours within a box in the mainscreen, and then determines where the object is? I think it was something about TPA but when i looked into it, i saw just 1 colour searching. if someone could link me to something that would be great.

Runaway

2012-06-22 00:30:55

Take a look at the cluster functions in my signature. :) beginner5 also has one you could probably find if you search "AND_TPA".

riwu

2012-06-22 00:32:19

FindColors(spiral)Tolerance? The parameter will be a TIntegerArray where u can enter multiple colors.

wantonman

2012-06-22 00:40:16

yeah riwu is right … it seems like you can use some auto color functions… use findcolorsspiraltolerance wich it will serch for the array of colors specified… then after you can use something like findobjectex or something similar… though what is it your trying to do so i can further assist you?

Runaway

2012-06-22 00:46:34

From: riwu
FindColors(spiral)Tolerance? The parameter will be a TIntegerArray where u can enter multiple colors.


From: wantonman
yeah riwu is right … it seems like you can use some auto color functions… use findcolorsspiraltolerance wich it will serch for the array of colors specified… then after you can use something like findobjectex or something similar… though what is it your trying to do so i can further assist you?


Uh… FindColorsTolerance is "Colors" instead of "Color" because it returns multiple points found in a TPA instead of one. It has nothing to do with searching for multiple colors :p To search multiple colors with it you'd have to use a for..to..do loop:


var
Colors: TIntegerArray;
TPA: TPointArray;
i: Integer;

Colors := [11111, 22222, 33333];
for i := 0 to High(Colors) do
begin
FindColorsTolerance(TPA, Colors[i], MSX1, MSY1, MSX2, MSY2, 5);
if (Length(TPA) >= 5) then
begin
// ...
end;
end;

zluo

2012-06-22 02:18:20

From: Runaway
Take a look at the cluster functions in my signature. :) beginner5 also has one you could probably find if you search "AND_TPA".


Thanks! exactly what i was looking for!