Simba Code:
program test;
{$i srl/srl.simba}
const
TREEX=120;
TREEY=81;
TREEX2=382;
TREEY2=226;
Function Choppin: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(249, 134, 277, 180);
Result := (AveragePixelShift(PBox, 500, 650) > 1500);
Writeln(IntToStr(AveragePixelShift(PBox, 500, 650)));
end;
Procedure Woodchop;
var
X, Y: Integer;
begin
if (Choppin) then
begin
writeln('Waiting to stop Cutting');
wait(100);
end else
begin
writeln('Lets look for a Tree');
if FindColorTolerance(X,Y,12400,TREEX,TREEY,TREEX2,TREEY2,10)then
MouseSpeed:=15;
mmouse(x, y,1,1);
Wait(350 + Random(150));
ClickMouse(X, Y, mouse_Left);
Wait(500 + Random(700));
end;
end;
begin
repeat
Woodchop;
until (IsKeyDown (114));
end.