Advertisement
mixster

mixster

Feb 15th, 2010
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.93 KB | None | 0 0
  1. var
  2.   mainloop: array of function(var position: Integer): Boolean;
  3.  
  4. function WalkToTree(var position: Integer): Boolean;
  5. begin
  6.   Result := False;
  7.   DoWalkStuff;
  8.   if WalkingFailed then
  9.     position := backupWalkingFunction''s integer;
  10.   Result := True;
  11. end;
  12.  
  13. function backupWalking(var position: Integer): Boolean;
  14. begin
  15.   Result := False;
  16.   DoWalkStuff;
  17.   if WalkingFailed then
  18.   begin
  19.     position := NextPlayerFalseFunction''s integer;
  20.     Exit;
  21.   end;
  22.  
  23.   position := chopTreeFunction''s integer;
  24.   Result := True;
  25. end;
  26.  
  27. function ChopTree(var position: Integer): Boolean;
  28. begin
  29.   Result := False;
  30.   repeat
  31.     SetTimer;
  32.     FindTree;
  33.     ChopTree;
  34.   until InvFull or TimerUp;
  35.  
  36.   if TimerUp then
  37.     position := NextPlayerFalseFunction''s integer
  38.   else
  39.     Result := True;
  40. end;
  41.  
  42. function Banking(var position: Integer): Boolean;
  43. begin
  44.   Result := False;
  45.   if not FindBank then
  46.   begin
  47.     position := NextPlayerFalseFunction''s integer;
  48.     Exit;
  49.   end;
  50.  
  51.   if not OpenBank then
  52.     if not OtherOpenBank then
  53.     begin
  54.       position := NextPlayerFalseFunction''s integer;
  55.       Exit;
  56.     end;
  57.  
  58.   DepositLogs;
  59.   GetAxe;
  60.   CloseBank;
  61.   position := NextPlayerTrueFunction''s Integer;
  62.   Result := True;
  63. end;
  64.  
  65. function NextPlayerSuccess(var position: Integer): Boolean;
  66. begin
  67.   NextPlayer(position = NextPlayerTrueFunction''s Integer);
  68.   Result := True;
  69. end;
  70.  
  71. var
  72.   i: Integer;
  73. begin
  74.   SetLength(mainloop, 4);
  75.   mainloop[0] := @WalkToTree;
  76.   mainloop[1] := @ChopTree;
  77.   mainloop[2] := @Banking; // shh, no one will know there isn''t a bank at the tree
  78.   mainloop[3] := @backupWalking; // backup goes at end
  79.   mainloop[4] := @NextPlayerSuccess; // for true
  80.   mainloop[5] := @NextPlayerSuccess; // for false
  81.  
  82.   i := 0;
  83.   repeat
  84.     if not LoggedIn then
  85.      LoginPlayer;
  86.    
  87.     if mainloop[i] then
  88.       Inc(i);
  89.  
  90.     Randoms;
  91.     Antiban;
  92.     Cheesecake;
  93.   until AllPlayersInactive;
  94. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement