Simba Code:
program WillowPowerChopper;
{$DEFINE SMART}
{$i SRL/srl.simba}
{$i sps/sps.simba}
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
End;
Var
x, y: Integer;
Function ChoppingWillows: Boolean;
Var
PBox: TBox;
begin
PBox := IntToBox(206, 92, 339, 208);
Result := (AveragePixelShift(PBox, 200, 350) > 250);
end;
Function WillowColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.29, 0.90);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 3957842, MSX1, MSY1, MSX2, MSY2, 8);
if (Length(arP) = 0) then
begin
Writeln('No Willows found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 4.87) and (X <= 12.91) and (Y >= 6.07) and (Y <= 16.27) and (Z >= 3.59) and (Z <= 10.23) then
begin
Result := arC[i];
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('Willow tree not found.');
End;
Procedure AntiBan;
Begin
Case Random(250) of
10:Begin
HoverSkill('Woodcutting', False);
Wait(1000+Random(500));
Mouse(659, 189, 0, 0, True);
End;
0..5:
Begin
HoverSkill('Random', False);
Wait(500 + Random(500));
Mouse(658, 190, 0, 0, True);
End;
0..5:
Begin;
Mouse(689, 188, 0, 0, True);
Wait(1200 + Random(300));
Mouse(660, 188, 0, 0, True);
End;
0..5:
Begin;
SleepAndMoveMouse(200 + Random(100));
End;
0..5:
Begin;
ExamineInv
End;
End;
End;
Procedure Chopping;
Begin
FindNormalRandoms;
Writeln('Searching for Willows...');
RandomMovement;
MakeCompass('Random');
If FindObjCustom(x, y, ['op', 'wn'], [WillowColor], 10) Then
Begin
Writeln('Willow founded.');
Wait(300 + Random(100));
Mouse( x, y, 2, 2, True);
Writeln('Chopping.');
if (ChoppingWillows) then
Antiban;
end;
repeat
AntiBan;
Until(Not ChoppingWillows)
End;
Procedure DropLogs;
Var I: integer;
Begin
for I:= 0 To 2 Do
Begin
Writeln('Dropping logs.')
DropAll
End;
End;
Begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
Repeat
Chopping;
If (InvFull) then
DropLogs;
Until(False)
End.