SCAR Code:
procedure HandleChopping;
var
Area, CX, CY, Ti, RandomNumber: Integer;
begin
if (X < CentreX) and (Y < CentreY) then Area := 1;
if (X > CentreX) and (Y > CentreY) then Area := 2;
if (X > CentreX) and (Y > CentreY) then Area := 3;
if (X < CentreX) and (Y > CentreY) then Area := 4;
Wait(RandomRange(1000, 1500));
MarkTime(Ti);
RandomNumber := RandomRange(25000, 30000);
repeat
case Area of
1: if (not FindColorTolerance(cx, cy, 4024409, TopLeft.x, TopLeft.y, CentreX, CentreY, 10)) or
(not FindColorTolerance(cx, cy, 1653294, TopLeft.x, TopLeft.y, CentreX, CentreY, 10)) then
Exit;
2: if (not FindColorTolerance(cx, cy, 4024409, TopRight.x, CentreY, CentreX, TopRight.y , 10)) or
(not FindColorTolerance(cx, cy, 1653294, TopRight.x, CentreY, CentreX, TopRight.y, 10)) then
Exit;
3: if (not FindColorTolerance(cx, cy, 4024409, CentreX, CentreY, BottomRight.x, BottomRight.y, 10)) or
(not FindColorTolerance(cx, cy, 1653294, CentreX, CentreY, BottomRight.x, BottomRight.y, 10)) then
Exit;
4: if (not FindColorTolerance(cx, cy, 4024409, BottomLeft.y, CentreX, BottomLeft.x,CentreY, 10)) or //Line 95
(not FindColorTolerance(cx, cy, 1653294, BottomLeft.y, CentreX, BottomLeft.x,CentreY, 10)) then
Exit;
end;
if InvFull then
begin
DropAll;
Exit;
end;
Wait(1000);
if (TimeFromMark(Ti) >= RandomNumber) then Break;
until false;
end;