Guest User

Untitled

a guest
Jun 3rd, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 3.60 KB | None | 0 0
  1. program HarpoonSupplier;
  2.  
  3. {$DEFINE SMART}
  4. {$i SRL/SRL.simba}
  5.  
  6. var
  7.   StartDTM : Integer;
  8.  
  9. const
  10.   SRLStats_Username = '';
  11.   SRLStats_Password = '';
  12.   Server            = 0;
  13.   Debug             = True;
  14.   Version           = 1.0;
  15.  
  16. procedure DeclarePlayers;
  17. begin
  18.   HowManyPlayers := 1;
  19.   NumberOfPlayers(HowManyPlayers);
  20.   CurrentPlayer  := 0;
  21.  
  22.   Players[0].Name   := '';
  23.   Players[0].Pass   := '';
  24.   Players[0].Nick   := '';
  25.   Players[0].Pin    := '';
  26.   Players[0].Active := True;
  27. end;
  28.  
  29. procedure DebugSupplier(message: String);
  30. begin
  31.   if (Debug) then
  32.     WriteLn('[DEBUG]: ' + message);
  33. end;
  34.  
  35. procedure LoadSDTMs;
  36. begin
  37.   StartDTM := DTMFromString('mlwAAAHicY2dgYEhnZmCwBmIbIM4G4hogrgDiQCCeCZQvBOI9QLyJAcLPBOIYIP7//z9DpL8xQ1FpIxhH28uCcWiQP8N/oDw/DsyIB0MBADQyEO0=');
  38. end;
  39.  
  40. procedure FreeSDTMs;
  41. begin
  42.   FreeDTM(StartDTM);
  43. end;
  44.  
  45. procedure SetupSupplier;
  46. var
  47.   x, y : Integer;
  48.   tmp : Extended;
  49. begin
  50.   Smart_Server := Server;
  51.   Smart_Signed := True;
  52.   SetupSRL;
  53.   SetupSRLStats(575, SRLStats_Username, SRLStats_Password);
  54.   DeclarePlayers;
  55.   ClearDebug;
  56.   LoadSDTMs;
  57.  
  58.   if (not(LoggedIn)) then
  59.     LoginPlayer;
  60.     Wait(3000);
  61.     DebugSupplier('Waiting 3 seconds.');
  62.  
  63.     // TODO: Shorten up this crap.
  64.     if (FindDTMRotated(StartDTM, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, tmp)) then
  65.     begin
  66.       DebugSupplier('Correct starting location.');
  67.     end else
  68.     begin
  69.       DebugSupplier('Invalid starting location.');
  70.     end;
  71.   FreeSDTMs;
  72. end;
  73.  
  74. procedure RestPlayer;
  75. begin
  76.   if (not(LoggedIn)) then
  77.     Exit;
  78.  
  79.   FindNormalRandoms;
  80.   DidRedClick;
  81.  
  82.   if (not(RunEnergy(30 + Random(20)))) then
  83.   begin
  84.     SetRest;
  85.     RestUntil(70 + Random(25));
  86.   end;
  87. end;
  88.  
  89. function OpenBankScreen: Boolean;
  90. begin
  91.   // Banking stuff.
  92.   Result := WaitFunc(@BankScreen, 10 + Random(5), 4000);
  93. end;
  94.  
  95. procedure HandleDoor;
  96. var
  97.   DoorTPA : TPointArray;
  98.   DoorPoint : Tpoint;
  99.   x, y, i : Integer;
  100. begin
  101.   if (FindColorsTolerance(DoorTPA, 2110521, MSX1, MSY1, MSX2, MSY2, 10)) then
  102.   begin
  103.     if (Length(DoorTPA) = 0) then FindColorsTolerance(DoorTPA, 2308414, MSX1, MSY1, MSX2, MSY2, 10);
  104.  
  105.     for i := 0 to High(DoorTPA) do
  106.     begin
  107.       DoorPoint := DoorTPA[i];
  108.       MMouse(DoorPoint.x, DoorPoint.y, 2, 2);
  109.       if (IsUpTextMultiCustom(['pen', 'Open'])) then
  110.       begin
  111.         GetMousePos(x, y);
  112.         Mouse(x, y, 1, 1, False);
  113.         ChooseOption('pen');
  114.         Wait(500 + Random(350));
  115.         Exit;
  116.       end;
  117.     end;
  118.   end;
  119. end;
  120.  
  121. function Walk_Shop: Boolean;
  122. var
  123.   ShopPath : TIntegerArray;
  124.   tmp : Extended;
  125.   i, h, x, y, DoorDTM : Integer;
  126. begin
  127.   {SetLength(ShopPath, 3);
  128.   ShopPath[0] := DTMFromString('mlwAAAHicY2dgYNBmZmCwAmInIA4G4lAgjgTicCC+AJRfA8SfgPgVEO8C4gkMEPEweymGsEADhpzSWjB2txRk8A/0AdP/gfL8ODAjHgwFAKQrDz4=');
  129.   ShopPath[1] := DTMFromString('mggAAAHicY2NgYNjNzMBwBIivAfFzIL4OxGuB+CFQbj4QnwDiF0D8HYhXA3FinDaDf6APg7ulIENOaS1DmL0UQ2maCcN/oBw/FsyIA0MAAKFBEH4=');
  130.   ShopPath[2] := DTMFromString('mlwAAAHicY2dgYPBkZmAwA+IcIPYDYn8gngHEwUD8GSj/AYh/APFNIGZnZGB4BaSXA3FgaCBDZKIug4eNKENtvg2Yn1fZxJAeY8TwHyjPjwMz4sFQAAAAlBAx');
  131.  
  132.   h := High(ShopPath);
  133.   for i := 0 to h do
  134.     if (FindDTMRotated(ShopPath[i], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/2.0, Pi/2.0, Pi/8, tmp)) then
  135.     begin
  136.       MouseFlag(x, y, 2, 2, 2);
  137.       DebugSupplier('Walking...');
  138.     end else
  139.       Exit;
  140.  
  141.   Result := True;
  142.   for i := 0 to h do
  143.     FreeDTM(ShopPath[i]);} // Commented out for testing purposes.
  144.   SetAngle(SRL_ANGLE_HIGH);
  145.   MakeCompass('S');
  146.   HandleDoor;
  147. end;
  148.  
  149. procedure Walk_Bank;
  150. begin
  151. end;
  152.  
  153. begin
  154.   SetupSupplier;
  155.   Walk_Shop;
  156. end.
Add Comment
Please, Sign In to add comment