Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- mainloop: array of function(var position: Integer): Boolean;
- function WalkToTree(var position: Integer): Boolean;
- begin
- Result := False;
- DoWalkStuff;
- if WalkingFailed then
- position := backupWalkingFunction''s integer;
- Result := True;
- end;
- function backupWalking(var position: Integer): Boolean;
- begin
- Result := False;
- DoWalkStuff;
- if WalkingFailed then
- begin
- position := NextPlayerFalseFunction''s integer;
- Exit;
- end;
- position := chopTreeFunction''s integer;
- Result := True;
- end;
- function ChopTree(var position: Integer): Boolean;
- begin
- Result := False;
- repeat
- SetTimer;
- FindTree;
- ChopTree;
- until InvFull or TimerUp;
- if TimerUp then
- position := NextPlayerFalseFunction''s integer
- else
- Result := True;
- end;
- function Banking(var position: Integer): Boolean;
- begin
- Result := False;
- if not FindBank then
- begin
- position := NextPlayerFalseFunction''s integer;
- Exit;
- end;
- if not OpenBank then
- if not OtherOpenBank then
- begin
- position := NextPlayerFalseFunction''s integer;
- Exit;
- end;
- DepositLogs;
- GetAxe;
- CloseBank;
- position := NextPlayerTrueFunction''s Integer;
- Result := True;
- end;
- function NextPlayerSuccess(var position: Integer): Boolean;
- begin
- NextPlayer(position = NextPlayerTrueFunction''s Integer);
- Result := True;
- end;
- var
- i: Integer;
- begin
- SetLength(mainloop, 4);
- mainloop[0] := @WalkToTree;
- mainloop[1] := @ChopTree;
- mainloop[2] := @Banking; // shh, no one will know there isn''t a bank at the tree
- mainloop[3] := @backupWalking; // backup goes at end
- mainloop[4] := @NextPlayerSuccess; // for true
- mainloop[5] := @NextPlayerSuccess; // for false
- i := 0;
- repeat
- if not LoggedIn then
- LoginPlayer;
- if mainloop[i] then
- Inc(i);
- Randoms;
- Antiban;
- Cheesecake;
- until AllPlayersInactive;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement