Guest User

Untitled

a guest
Apr 22nd, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 9.63 KB | None | 0 0
  1. program SilentFlax;
  2. // Includes...
  3. {$i srl/srl/misc/smart.scar}
  4. {$loadlib sps}
  5. {$i srl/srl.scar}
  6. {$i sps/sps.simba}
  7. {$i SRL/SRL/Misc/stats.simba}
  8.  
  9. const
  10.   SRLStats_User = 'SilentStat'; // Your SRL Stats ID (If you dont have one then just leave it as it is)
  11.   SRLStats_Password = 'report'; // Your SRL Stats Password (If you dont have one then just leave it as it is)
  12. Var
  13. X, Y, T, W, Flax, Breaks, Loads: Integer;
  14.  
  15. procedure DeclarePlayers;
  16. begin
  17.   HowManyPlayers := 1; // This is set to the total amount of players,  for now, just keep it set as 1
  18.   NumberOfPlayers(HowManyPlayers); // Don't touch
  19.   CurrentPlayer := 0; // This is the player to start with; the first player will always be 0
  20.  
  21.   Players[0].Name := ''; // Username
  22.   Players[0].Pass := ''; // Password
  23.   Players[0].Active := True; // Set to true if you want to use Player 0
  24.   Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
  25.   Players[0].Integers[1] := 200;//# of loads to do.
  26.   Players[0].Integers[2] := 720; // Time before breaking ( In minutes)
  27. end;
  28.  
  29. procedure SetupLogin;
  30. begin
  31.   ClearDebug;
  32.   // Setting up SMART;
  33.   Smart_Server := 9;
  34.   Smart_Members := True;
  35.   Smart_Signed := True;
  36.   Smart_SuperDetail := False;
  37.   SetupSRL;
  38.   SetupSRLStats(295, SRLStats_User, SRLStats_Password);
  39.   DeclarePlayers;
  40.   LoginPlayer; //  Logging in...
  41. end;
  42.  
  43. procedure BreakTime;
  44. var
  45. s, i: Integer;
  46. begin
  47.   if (s = 0) then
  48.     s := Players[0].Integers[2] * 60000; //+ RandomRange(300000, 600000);
  49.   if T = 1 then
  50.   begin
  51.     W:= GetTimeRunning;
  52.     if (W > s) then
  53.     begin
  54.       Logout;
  55.       i:= RandomRange(10, 15);
  56.       Writeln('Taking a break for ' + IntToStr(i) + ' minutes');
  57.       i:= i * 60000;
  58.       Wait(i);
  59.       T := 0;
  60.       s:= W + s;
  61.       Inc(Breaks);
  62.       LoginPlayer;
  63.     end;
  64.   end else
  65.   if T = 0 then
  66.   begin
  67.     T := T + 1;
  68.   end;
  69.  
  70. end;
  71.  
  72. procedure SetupSps;
  73.  
  74. begin
  75.   SPS_Setup(RUNESCAPE_SURFACE, ['6_6','6_7']);
  76.   SPS_Continue := false;
  77. end;
  78.  
  79. procedure StartFancy;
  80. var
  81. i: Integer;
  82. e: String;
  83. begin
  84. e := '=';
  85. while i < 68 do
  86. begin
  87.   Writeln(e);
  88.   if (InRange(i, 1, 19)) then
  89.   begin
  90.     Writeln('   /// ');
  91.     Writeln('  / /  ');
  92.     Writeln(' / /   ');
  93.     Writeln(' \ \   ');
  94.     Writeln('  \ \  ');
  95.     Writeln('   \\\ ');
  96.   end;
  97.   if (InRange(i, 20, 29)) then
  98.   begin
  99.     Writeln('   ///  |--------| ');
  100.     Writeln('  / /   | |------| ');
  101.     Writeln(' / /    | |        ');
  102.     Writeln(' \ \    | |---|    ');
  103.     Writeln('  \ \   | |        ');
  104.     Writeln('   \\\  |_|        ');
  105.   end;
  106.   if (InRange(i, 30, 39)) then
  107.   begin
  108.     Writeln('   ///  |--------| |-|        ');
  109.     Writeln('  / /   | |------| | |        ');
  110.     Writeln(' / /    | |        | |        ');
  111.     Writeln(' \ \    | |---|    | |        ');
  112.     Writeln('  \ \   | |        | |______  ');
  113.     Writeln('   \\\  |_|        |________| ');
  114.   end;
  115.   if (InRange(i, 40, 49)) then
  116.   begin
  117.     Writeln('   ///  |--------| |-|             /--\     ');
  118.     Writeln('  / /   | |------| | |            / /\ \    ');
  119.     Writeln(' / /    | |        | |           / /  \ \   ');
  120.     Writeln(' \ \    | |---|    | |          / /----\ \  ');
  121.     Writeln('  \ \   | |        | |______   / /------\ \ ');
  122.     Writeln('   \\\  |_|        |________| /_/        \_\');
  123.   end;
  124.   if (InRange(i, 50, 59)) then
  125.   begin
  126.     Writeln('   ///  |--------| |-|             /--\        \~\    /~/');
  127.     Writeln('  / /   | |------| | |            / /\ \        \ \  / / ');
  128.     Writeln(' / /    | |        | |           / /  \ \        \ \/ /  ');
  129.     Writeln(' \ \    | |---|    | |          / /----\ \       / /\ \  ');
  130.     Writeln('  \ \   | |        | |______   / /------\ \     / /  \ \ ');
  131.     Writeln('   \\\  |_|        |________| /_/        \_\   /_/    \_\');
  132.   end;
  133.   if (InRange(i, 60, 69)) then
  134.   begin
  135.     Writeln('   ///  |--------| |-|             /--\        \~\    /~/   \\\  ');
  136.     Writeln('  / /   | |------| | |            / /\ \        \ \  / /     \ \ ');
  137.     Writeln(' / /    | |        | |           / /  \ \        \ \/ /       \ \');
  138.     Writeln(' \ \    | |---|    | |          / /----\ \       / /\ \       / /');
  139.     Writeln('  \ \   | |        | |______   / /------\ \     / /  \ \     / / ');
  140.     Writeln('   \\\  |_|        |________| /_/        \_\   /_/    \_\   ///  ');
  141.   end;
  142.   Writeln(e);
  143.   e := e + '=';
  144.   Wait(50);
  145.   Inc(i);
  146.   ClearDebug;
  147. end;
  148. Writeln('====================================================================');
  149. Writeln('   ///  |--------| |-|             /--\        \~\    /~/   \\\ ');
  150. Writeln('  / /   | |------| | |            / /\ \        \ \  / /     \ \');
  151. Writeln(' / /    | |        | |           / /  \ \        \ \/ /       \ \');
  152. Writeln(' \ \    | |---|    | |          / /----\ \       / /\ \       / /');
  153. Writeln('  \ \   | |        | |______   / /------\ \     / /  \ \     / /');
  154. Writeln('   \\\  |_|        |________| /_/        \_\   /_/    \_\   ///');
  155. Writeln('=================Brought to you by Silent SPY=======================');
  156. Wait(5000);
  157. end;
  158.  
  159.  
  160.  
  161. procedure Antiban; //idea taken from Coh3n's tutorial.
  162. begin
  163.   if not (LoggedIn) then
  164.     Exit;
  165.   begin
  166.     case Random(100) of // Random(100) generates a random integer from 0 to 59
  167.       10: RandomRClick;
  168.       30: PickUpMouse;
  169.       50: RandomMovement;
  170.       70: BoredHuman;
  171.       89: ExamineInv;
  172.     end;
  173.   end;
  174. end;
  175.  
  176. procedure RestUp;
  177. begin
  178.   if not (LoggedIn) then
  179.     Exit;
  180.   begin
  181.     SetRest;
  182.     while not RunEnergy(95) do
  183.     begin
  184.       Antiban;
  185.       Wait(Random(1000));
  186.     end;
  187.   end;
  188. end;
  189.  
  190. function Banking: Boolean;
  191. var
  192. p, t: Integer;
  193.  
  194. begin
  195. if not (LoggedIn) then
  196.   Exit;
  197.   if (InvCount < 1) then
  198.     Exit;
  199.   while (IsMoving) do
  200.   begin
  201.     Wait(RandomRange(900, 1200));
  202.   end;
  203. t := 0; //Tries starts at zero
  204.   repeat
  205.     Inc(t);
  206.     Writeln('Trying to open the bank, this is the ' + IntToStr(t) + ' try out of 5');
  207.     MakeCompass('n');
  208.     Wait(RandomRange(700, 1000));
  209.     OpenBankNPC;
  210.   until BankScreen or PinScreen or (t = 5);
  211.  
  212.   if PinScreen then
  213.   begin
  214.   p := 0;
  215.     repeat
  216.       InPin(Players[0].Pin);
  217.       Inc(p)
  218.     until BankScreen or (p > 0) or not (LoggedIn);
  219.   end;
  220.  
  221.   if BankScreen then
  222.   begin
  223.     Writeln('Opened the bank...');
  224.     DepositAll;
  225.     Wait(RandomRange(500, 1500));
  226.     CloseBank;
  227.   end;
  228.  
  229.   if (t = 5) then
  230.   begin
  231.     Writeln('failed to find bank.');
  232.     Writeln('Terminating...');
  233.     TerminateScript;
  234.   end;
  235. end;
  236.  
  237. function Walking(Color, Tolerance: Integer; SortFrom: tpoint): Boolean;// credit to Camaro' for the tutorial and function!
  238. var
  239.   i, x, y, rx, ry: Integer;
  240.   TPA: TPointArray;
  241. begin
  242.   if not LoggedIn then Exit;
  243.   FindNormalRandoms;
  244.   FindColorsSpiralTolerance(MMCX, MMCY, TPA, Color, MMX1, MMY1, MMX2, MMY2, Tolerance);
  245.   SortTPAFrom(TPA, SortFrom);
  246.  
  247.   for i := 0 to High(TPA) do
  248.   begin
  249.     x := TPA[i].x;
  250.     y := TPA[i].y;
  251.  
  252.     rx := RandomRange(-6, 6);
  253.     ry := RandomRange(-6, 6);
  254.     if (not rs_OnMinimap(x + rx, y + ry)) then
  255.       Continue;
  256.  
  257.     Mouse(x + rx, y + ry, 0, 0, true);
  258.     FFlag(0);
  259.     Wait(200 + Random(500));
  260.     Result := True;
  261.     Break;
  262.   end;
  263. end;
  264.  
  265. procedure WalkToFlax;
  266. var
  267. BankToFlax: TPointArray;
  268.  
  269. begin
  270.   if not (LoggedIn) then
  271.     Exit;
  272.   if not FindNormalRandoms then
  273.   begin
  274.     if not RunEnergy(25) then
  275.       RestUp;
  276.     MakeCompass('n');
  277.     Writeln('Walking to Flax...');
  278.     Wait(Random(1000));
  279.     BankToFlax := [Point(2745, 2713), Point(2751, 2751),
  280.                    Point(2761, 2811), Point(2771, 2853),
  281.                    Point(2801, 2863)];
  282.     if SPS_WalkPath(BankToFlax) then
  283.       Writeln('At the Field..');
  284.     Wait(RandomRange(1200, 1500));
  285.   end;
  286. end;
  287.  
  288. procedure GetFlax;
  289. var
  290. i: Integer;
  291. begin
  292.   if not (LoggedIn) then
  293.     Exit;
  294.   if not (FindNormalRandoms) then
  295.   begin
  296.     SetAngle(true);
  297.     while (InvCount < 28) do
  298.     begin
  299.       while (IsMoving) do
  300.       X:= MSCX;
  301.       Y:= MSCY+30;
  302.       Wait(RandomRange(1000, 1500));
  303.       if(FindColorSpiralTolerance(X, Y, 14407266, MSX1, MSY1, MSX2, MSY2, 41)) then
  304.       begin
  305.         Mouse(X, Y, 10, 10, true);
  306.         Wait(RandomRange(500, 1000));
  307.         AntiBan;
  308.       end else
  309.         Break;
  310.     end;
  311.   end;
  312. end;
  313.  
  314. procedure Progress;
  315. begin
  316.   if not (LoggedIn) then
  317.     Exit;
  318.   if (InvCount = 28) then
  319.   begin
  320.     Flax:= Flax + 28;
  321.     ClearDebug;
  322.     Writeln('|=======================================|');
  323.     Writeln('| Flax | Loads | Time Running |# of Breaks|');
  324.     Writeln('|' + IntToStr(Flax) + '  |' + IntToStr(Loads) + '  |' + TimeRunning + '|' + IntToStr(Breaks) + '|');
  325.     Writeln('|=======================================|');
  326.     Writeln('');
  327.     stats_IncVariable('Flax (Picked))', 28);
  328.     stats_IncVariable('Loads Done', 1);
  329.     SRLRandomsReport;
  330.     Stats_Commit;
  331.   end;
  332. end;
  333.  
  334. procedure WalkToBank;
  335. var
  336. FlaxToBank: TPointArray;
  337.  
  338. begin
  339.   if not (LoggedIn) then
  340.     Exit;
  341.   if not FindNormalRandoms then
  342.   begin
  343.     if not RunEnergy(25) then
  344.       RestUp;
  345.     MakeCompass('n');
  346.     Writeln('Walking to Bank...');
  347.     Wait(Random(1000));
  348.     FlaxToBank := [Point(2802, 2873), Point(2764, 2851),
  349.                    Point(2745, 2800), Point(2745, 2755),
  350.                    Point(2743, 2722), Point(2740, 2679)];
  351.     if SPS_WalkPath(FlaxToBank) then
  352.       Writeln('At the Bank..');
  353.     Wait(RandomRange(1200, 1500));
  354.   end;
  355. end;
  356.  
  357. procedure MainLoop;
  358. begin
  359.   SetupLogin;
  360.   SetupSps;
  361.   T := 0;
  362.   for Loads := 0 to Players[0].Integers[1] do
  363.   begin
  364.     if not (LoggedIn) then
  365.       Break;
  366.     BreakTime;
  367.     Banking;
  368.     WalkToFlax;
  369.     GetFlax;
  370.     WalkToBank;
  371.     Progress;
  372.   end;
  373. end;
  374.  
  375. begin
  376.   StartFancy;
  377.   MainLoop;
  378. end.
Add Comment
Please, Sign In to add comment