program CRABS;
{$i SRL/SRL.simba}
{$DEFINE SMART}
function STEP1: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.89, 1.37);
if not (FindColorsTolerance(arP, 3555393, MMX1, MMY1, MMX2, MMY2, 3)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
end;
function STEP2: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.00, 0.13);
if not (FindColorsTolerance(arP, 4213580, MMX1, MMY1, MMX2, MMY2, 1)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
function STEP3: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.55, 0.21);
if not (FindColorsTolerance(arP, 4805975, MMX1, MMY1, MMX2, MMY2, 2)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
procedure WalkToCrabs;
begin
Setrun(true); //this turns run on
for i:- 1 to 3
case RadialWalking of
1: RadialWalkTolerance(STEP1, 308, 321, 50, 5, 5, 20);
2: RadialWalkTolerance(STEP2, 274, 286, 63, 5, 5, 20);
3: RadialWalkTolerance(STEP3, 254, 274, 39, 5, 5, 20);
end;
begin
WalkToCrabs
end.