Universal AutoColor function
My first function:
SCAR Code:
function FindMyColor(Color,Tol : Integer) : Integer;
var
x,y,YourColor,U,K : Integer;
begin
MarkTime(U);
if FindColorTolerance(x, y, Color, MMX1, MMY1, MMX2, MMY2, Tol) then
begin
YourColor := GetColor(x,y);
Writeln('Your Color = '+ IntToStr(YourColor));
K := TimeFromMark(U);
Writeln('Took '+ IntToStr(K)+' mscs');
Result := YourColor;
end else
begin
Writeln('Could not find your color!');
end;
end;
Code:
Your Color = 2130293
Took 31 mscs
Successfully executed