it has not problem at all finding the grey color, but when it moves the mouse over to click, it goes to the top right corner and terminates the script with no errors in the debug box.
SCAR Code:
function FindColHue(var a, b: integer; color: longint; x, y, cx1, cy1, cx2, cy2, tol: integer; hue, sat: extended): boolean;
var
CTS, I: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(hue, sat);
FindColorsSpiralTolerance(x, y, TPA, color, cx1, cy1, cx2, cy2, tol);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);
For I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
Result := True;
mmouse(x, y, 5, 5);
getmousepos(x, y);
Break;
end;
end;
im thinking its more of this procedure, but heres the proc that its used in
SCAR Code:
procedure gotocenter;
var x, y: integer;
center: boolean;
begin
wait(2000 + random(1000));
center:= FindColHue(x, y, 8553100, MMCX, MMCY, MMX1, MMY1, MMX2, MMY2, 20, 1.66, 0.03);
if center then
begin
mouse(x, y, 5, 5, true);
flag;
end else messup('Cannot find the center');
end;