SRL Archive - News and General

Rate this function and give pointers


radiclerobby

2012-03-08 01:14:46

I beleve this method is used by quite a few people but id like to know if my object finding method is up to SRL par :P here it is pointers and comments will be appreciated.

to use this function you need to use the autocolor aid provided here http://villavu.com/forum/showthread.php?t=26944&highlight=auto+color

and use color speed 2:P we will see who gets it working because it does work :))


function findObjectCustom(hue, sat:Extended; color, tol, pixels:integer; strin:string):boolean;
var
TPA: TPointArray;
ATPA: Array of TPointArray;
i, TolSpeed, x, y:integer;
hueStart, satStart:extended;
begin
getTolerancespeed2Modifiers(hueStart, satStart);
TolSpeed := getToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(sat, hue);
if(FindColorsTolerance(TPA, color, MSX1, MSY1, MSX2, MSY2, tol))then
begin
ATPA := SplitTpa(TPA, 5);
for i:=0 to high(ATPA) do
begin
if(length(ATPA[i])>= pixels)then
begin
MMouse(MiddleTPA(ATPA[i]).x, MiddleTPA(ATPA[i]).y, 3, 3);
if(isuptext(strin))then
begin
Clickmouse2(1);
result:=true;
SetColorToleranceSpeed(TolSpeed);
SetToleranceSpeed2Modifiers(hueStart, satStart);
exit;
end;
end;
end;
end;
SetColorToleranceSpeed(TolSpeed);
SetToleranceSpeed2Modifiers(hueStart, satStart);
result:=false;
end;

Gucci

2012-03-08 01:20:25

I used to do this without color aid until like a few days ago