Log in

View Full Version : problem with FindColorTolerance



Nexz
09-17-2012, 09:34 AM
if FindColorTolerance(x,y,14099230,619,283,619,283,20 ) then
begin
Print('> color found');
end else begin
Print('> color not found');
end;
i keep getting color not found

i tried smart, without smart (with select tool), diff cords + colors

it only finds the color if the tol is 200+

(note: i've used this, and other color finding functions a million times and i have no idea why it suddently doesn't work anymore)


function FindColorTolerance(var x, y: Integer; col, x1, y1, x2, y2, tol: Integer): Boolean;

Le Jingle
09-17-2012, 09:36 AM
I see you are using static coordinates?
Perhaps try adding -50 to your y1 value and your y2 value, if intended for the RS client.

if FindColorTolerance(x, y, 14099230, 619, 283-50, 619, 283-50, 20) then
WriteLn('yes')
else
WriteLn('no');

P1ng
09-17-2012, 09:41 AM
Your also searching in a very precise pixel, try widening the area a little bit, maybe even just make it a 3x3px box could help.

Also, make sure you have the client selected when getting the co-ords and do as LJ said, if it's for RS try removing 50px from your y co-ords.

Nexz
09-17-2012, 09:47 AM
I see you are using static coordinates?
Perhaps try adding -50 to your y1 value and your y2 value, if intended for the RS client.

if FindColorTolerance(x, y, 14099230, 619, 283-50, 619, 283-50, 20) then
WriteLn('yes')
else
WriteLn('no');

i didn't know about static coords
but it works now, thank you!

Nexz
09-17-2012, 09:54 AM
Your also searching in a very precise pixel, try widening the area a little bit, maybe even just make it a 3x3px box could help.

Also, make sure you have the client selected when getting the co-ords and do as LJ said, if it's for RS try removing 50px from your y co-ords.
yea, its just an example
thanks tho!