Sawyer
2013-01-21 23:07:05
VERY SIMPLE willow power chopper. All suggestions/critiques are very welcome. :) *Please remember I'm just learning*
program PowerChopper;
{$DEFINE SMART8}
{$I SRL/SRL.Simba}
var
Status:String;
WillowsLost:Boolean;
procedure DeclarePlayers;
begin
Status := ('Logging in player.')
writeln('Logging in player.')
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := ''; // Player username
Pass := ''; // Player password
Active := True;
end;
end;
procedure SetupSmartClient;
begin
SRL_SixHourFix := True;
SMART_FixSpeed := True;
ClearDebug;
SetupSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
end;
Procedure SetupBot;
begin
ClickNorth(0)
end;
Procedure Antiban; // Credit to Solidone40
Begin
Status :=('Antiban')
Case Random(100) Of
1: HoverSkill('woodcutting', False); //replace 'magic' with 'skill'
2: HoverSkill('random', False);
3: Boredhuman;
4: Wait(2500 + random(4500));
5: HoverSkill('random', False); // replace 'smithing' with 'skill', or delete.
6: PickUpMouse;
7: RandomMovement;
8: RandomRClick;
end;
end;
Function IsWoodcutting: Boolean; //Credit to Ubuntu
var
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195);
Result := (AveragePixelShift(PBox, 500, 650) > 400);
end;
Procedure CutWillows;
var
X,Y:Integer;
YewLocation:integer;
begin
Status :=('Finding and cutting willows.');
writeln('Finding and cutting willows.');
Repeat
While IsWoodcutting Do Wait(2000+Random(50));
if FindObjCustom(x, y, ['illow', 'own Wi'], [2502705, 2371118, 1976103], 20) then
Mouse(x, y, 4, 3, false);
ChooseOption('Will');
Until InvFull
begin
DropAll;
Case Random(3) Of
1: Antiban;
end;
end;
end;
begin
SetupSmartClient;
SetupBot;
Repeat
CutWillows;
Until(AllPlayersInactive)
WriteLn('Finishing Script.');
end.