Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 21st, 2010 | Syntax: None | Size: 4.83 KB | Hits: 50 | Expires: Never
Copy text to clipboard
  1. program SteveAutoAlcher;
  2. {.include srl/srl.scar}
  3. {
  4. -Consts
  5. -*Player username
  6. -*Player password
  7. -*Breaks
  8. -*Do you want the script to auto-bank when done?
  9. -**Bank pin
  10. -*Make DTM (DONE)
  11. -
  12. }
  13. var
  14.   x, y, NumberOfAlchs, SinceBreak: Integer;
  15.  
  16. const
  17. /////////////////////////////Setup Starts Here\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  18.                                                    //Alchemizing? xD
  19.   HowManyAlchs           = 500;  //How much are we alchemizing?
  20.   TakeBreaks             = True; //Do You Want to take breaks
  21.   BreakAfter             = 60;   //How Long you want to work for before you take a 15 min break (In Minutes (0 = Do not break))
  22.   BreakFor               = 10;   //How long would you like to break for? (0 = Do not break)
  23.   BreakForRandom         = 5;    //Add this many random minutes into BreakFor
  24.   ChanceOfNotBreaking    = 60;   //Out of 100, chance of not breaking at all
  25. { I'm confused with the chance of not breaking part.. I don't see the point. :p
  26. I really like the readability of a line of constants. To me it just more
  27. organized, especially with the spacing. Yes, it's also simpler (for me).}
  28.  
  29. Procedure DeclarePlayers;
  30. begin
  31.   HowManyPlayers := 1 ;
  32.   NumberOfPlayers(HowManyPlayers);
  33.   CurrentPlayer := 0;
  34.  
  35.   with players[0] do
  36.   begin
  37.     Name := 'iaannnn';
  38.     Pass := 'lolipop90';
  39.     Nick := '';
  40.     Active := True;
  41.     Pin := '';
  42.   end;
  43. end;
  44. {I don't know of many alchers (none, in fact) that need multipayer support.}
  45.  
  46. //////////////////////////////Setup Ends Here\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  47. Procedure DragItems;
  48. var
  49.   BankNote :Integer;
  50. begin
  51.   BankNote := DTMFromString('78DA637CC0C2C0D0C9C8800CB62FAB02D3305' +
  52.        '1C6874035ADA86A18189850D53C06AAE921A0E60450CD3CFC6A00' +
  53.        'DAB8079E');
  54.   if (GameTab(tab_Inv)) then
  55.   begin
  56.     if FindDTM(BankNote, x, y, MIX1, MIY1, MIX2, MIY2) then
  57.     begin
  58.       WriteLn('Dragging Item');
  59.       DragMouse(x, y, 3, 3, 704, 339, 3, 0);
  60.     end;
  61.     WriteLn('Item Dragged')
  62.   end;
  63. end;
  64.  
  65.  
  66. Procedure ClickNote;
  67. var
  68.   BankNote :Integer;
  69. begin
  70.   BankNote := DTMFromString('78DA637CC0C2C0D0C9C8800CB62FAB02D3305' +
  71.        '1C6874035ADA86A18189850D53C06AAE921A0E60450CD3CFC6A00' +
  72.        'DAB8079E');
  73.   if (GameTab(tab_inv)) then
  74.   begin
  75.     WriteLn('Finding DTM BankNote');
  76.     if FindDTM(BankNote, x, y, MIX1, MIY1, MIX2, MIY2) then
  77.     begin
  78.       WriteLn('Clicking DTM, BankNote');
  79.       Mouse(x, y, 10, 10, true); {I'm not acquainted with offset; this good enough?}
  80.     end else                     //I'd do smaller randoms. Maybe 5, 5.
  81.     begin
  82.       Logout;
  83.       FreeDTM(BankNote);
  84.       TerminateScript;
  85.     end;
  86.   end;
  87.  // FreeDTM(BankNote);  {Any better way to free this?}  You don't want to free it every time.
  88. end;
  89.  
  90. Procedure ClickAlch;
  91. var
  92.   HighAlch :Integer;
  93. begin
  94.   HighAlch := DTMFromString('78DA639464606010614001871608806946289' +
  95.        'F51064870A2AA6144A741F2A2A86AA4189950D50801094902E680' +
  96.        'DC2288AA469319CD1C79202186DF1C00AB2E02C2');
  97.   WriteLn('Switching to magic gametab');
  98.   GameTab(tab_Magic);
  99.   if FindDTM(HighAlch, x, y, MIX1, MIY1, MIX2, MIY2) then
  100.   begin
  101.     WriteLn('Found High Alch, clicking');
  102.     Mouse(x, y, 7, 3, true); {One again, with offsets} //I might even move items during runtime to make it so that no movement is necessary. :)
  103.     WriteLn('Clicked on HighAlch');                    //I can show you how to do that if you want. x] It'd be suhweet.
  104.     FreeDTM(HighAlch);
  105.     WriteLn('HighAlch DTM freed');
  106.   end else    //I might have more failsafes to make sure there's not just lag or something..
  107.   begin
  108.     LogOut;
  109.     WriteLn('Could not find highalch, logging out');
  110.     FreeDTM(HighAlch);
  111.     TerminateScript;
  112.   end;
  113. end;
  114.  
  115. Procedure DoBreak;  {Thanks. I had to look over like, 10 scripts that had break to get it all down though.}
  116. var
  117.   Breaktime, LastBreak, BreakForRandom2, BreakFor2:Integer;
  118. Begin
  119.   BreakTime := BreakAfter * 60 * 1000;
  120.   LastBreak := TimeFromMark(SinceBreak);
  121.   If(BreakTime <= LastBreak) then
  122.   begin
  123.     Logout;
  124.     if(BreakForRandom = 0) then
  125.     begin
  126.       Wait(BreakFor * (1000 * 60));
  127.       LoginPlayer;
  128.       SetAngle(True);
  129.       MarkTime(SinceBreak);
  130.     end else
  131.     begin
  132.       BreakForRandom2 := BreakForRandom * 1000 * 60 ;
  133.       BreakFor2 := BreakFor * (1000 * 60)+(RandomRange(0, BreakForRandom2));
  134.       Wait(BreakFor2);
  135.       LoginPlayer;
  136.       SetAngle(True);
  137.       MarkTime(SinceBreak);
  138.     end;
  139.   end;
  140. end;
  141.  
  142. begin
  143. //NumberOfAlchs := HowManyAlchs; You'll see below. :)
  144.   ClearDebug;
  145.   SetUpSRL;
  146.   MarkTime(SinceBreak);
  147.   DragItems;
  148.   repeat
  149.     MouseSpeed := 12 + Random(5);
  150.     ClickAlch;
  151.     ClickNote;
  152.     Inc(NumberOfAlchs); //Dec(NumberOfAlchs); Look below.
  153.     wait(3000);
  154.     if TakeBreaks then
  155.       DoBreak;
  156.   until(NumberOfAlchs >= HowManyAlchs);//until(HowManyAlchs = 0);Because I said so.
  157. end.