SRL Archive - Help

problem with FindColorTolerance


Nexz

2012-09-17 05:34:35

  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

2012-09-17 05:36:05

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

2012-09-17 05:41:04

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

2012-09-17 05:47:02

From: Le Jingle
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

2012-09-17 05:54:50

From: P1ng
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!