Advertisement
Guest User

Untitled

a guest
Nov 6th, 2016
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.30 KB | None | 0 0
  1. program rsos;
  2. {$include_once lib/HeavenBot.simba}
  3.  
  4. procedure sambuka;
  5. begin
  6. checkInventory();
  7.  
  8. if (account.inventory_full = true) then
  9. begin
  10. teleport('falador');
  11. walk('bank');
  12. npc('grey_banker', 'bank');
  13. item('wine_of_zamorak', 'deposit_all');
  14. closeBank();
  15. end
  16. else
  17. begin
  18. if (searchForFlag(DTM.path.zamorak_palace[11])) then
  19. begin
  20. repeat
  21. telegrab();
  22. waitForItem('wine_of_zamorak');
  23. checkInventory();
  24. until (account.inventory_full = true)
  25. end
  26. else
  27. begin
  28. walk('zamorak_palace');
  29. end;
  30. end;
  31. end;
  32.  
  33.  
  34. /heavenbot include
  35. {$i srl-6/srl.simba}
  36. {$I RSWalker/Walker.simba}
  37. {$include_once lib/types.simba}
  38. {$include_once lib/config.simba}
  39. {$include_once lib/DTM.simba}
  40. {$include_once lib/other.simba}
  41. {$include_once lib/search.simba}
  42. {$include_once lib/cursor.simba}
  43. {$include_once lib/interface.simba}
  44. {$include_once lib/inventory.simba}
  45. {$include_once lib/spellbook.simba}
  46. {$include_once lib/walking.simba}
  47. {$include_once lib/npc.simba}
  48. {$include_once lib/bank.simba}
  49. {$include_once lib/objects.simba}
  50. {$include_once lib/system.simba}
  51.  
  52. /config include
  53. // ------------ Main variables ------------ //
  54. var bot_wait = 500;
  55. var bot_loop = true;
  56. var bot_isWaiting = false;
  57.  
  58. var screen: coord;
  59. var cursor: coord;
  60. var last_cursor: coord;
  61. var searching: coord;
  62. var osrs: app;
  63. var account: user;
  64. var last_path_flag: integer;
  65.  
  66. var DTM: target;
  67.  
  68. var RSW: TRSWalker;
  69. var RSW_test: TRSPosFinder;
  70. var path: TPointArray;
  71. var loc: TPoint;
  72. var t: UInt32;
  73. var walker_set = false;
  74. var testing = true;
  75.  
  76. procedure configurate()
  77. begin
  78. SetDesktopAsClient();
  79. MoveMouse(0, 0);
  80.  
  81. account.username := '';
  82. account.password := ';
  83. account.online := false;
  84. account.inventory_full := false;
  85.  
  86. cursor.x := 0;
  87. cursor.y := 0;
  88.  
  89. osrs.running := false;
  90. end;
  91.  
  92. //system include
  93. // ------------ Start OSRS ------------ //
  94. Function startOsrs(): Boolean;
  95. begin
  96. execute();
  97.  
  98. repeat
  99. if (FindAndSetTarget('Old School RuneScape', true) = True) then
  100. begin
  101. console(['loaded - osrs.exe']);
  102. osrs.running := true;
  103. end
  104. until(osrs.running = true);
  105. end;
  106.  
  107. // ------------ Check All Running Processes ------------ //
  108. Function checkOsrsRunning(): Boolean;
  109. var running: boolean;
  110. begin
  111. running := FindAndSetTarget('Old School RuneScape', true);
  112.  
  113. if (running = True) then
  114. begin
  115. console(['osrs.exe is running']);
  116. end
  117. else
  118. begin
  119. console(['starting osrs.exe']);
  120. startOsrs();
  121. end;
  122.  
  123. GetClientDimensions(screen.x, screen.y);
  124. screen.x := 764-1;
  125. screen.y := 502-1;
  126. console(['size: ', screen.x, 'x', screen.y]);
  127. MouseSetClientArea(33, 36, 797, 538);
  128. ImageSetClientArea(33, 36, 797, 538);
  129. end;
  130.  
  131. procedure doPage(page: integer)
  132. begin
  133. case page of
  134. 1: begin
  135. console(['page - loading']);
  136. end
  137. 2: begin
  138. console(['page - welcome']);
  139. clickButton('existing_user', 125, 30);
  140. end
  141. 3: begin
  142. console(['page - Not a member']);
  143. clickButton('switch_world', 90, 25);
  144. end
  145. 4: begin
  146. console(['page - worlds']);
  147. clickButton('w_394', 80, 15);
  148. clickButton('login', 125, 32);
  149. end
  150. 5: begin
  151. console(['page - start']);
  152. clickButton('play', 220, 80);
  153. end
  154. 6: begin
  155. console(['page - Bad username or password']);
  156. clickButton('try_again', 125, 30);
  157. clickButton('cancel', 125, 30);
  158. end;
  159. 7: begin
  160. console(['page - login']);
  161. typeText(account.username);
  162. Wait(250+Random(250));
  163.  
  164. PressKey(13);
  165. Wait(250+Random(500));
  166.  
  167. console(['Typing password']);
  168. typeText(account.password);
  169. Wait(500+Random(500));
  170.  
  171. clickButton('login', 125, 30);
  172. end;
  173. end;
  174. end;
  175.  
  176. // ------------ Initialize ------------ //
  177. Function initialize(): Boolean;
  178. begin
  179. configurate();
  180. setDTM();
  181. checkOsrsRunning();
  182.  
  183. repeat
  184. osrs.page := determinePage();
  185. if (osrs.page = 0) then // Game screen
  186. begin
  187. if (testing = true) then
  188. begin
  189. if (walker_set = false) then
  190. begin
  191. RSW_test.Init(w_getClientPID());
  192. RSW_test.UpdateMap(True);
  193. walker_set := true;
  194. end;
  195.  
  196. RSW_test.DebugPos(loc);
  197. end
  198. else
  199. begin
  200. sambuka;
  201. end;
  202. end
  203. else
  204. begin // Login screen
  205. doPage(osrs.page);
  206. end;
  207.  
  208. wait(Random(800));
  209. until(bot_loop = false);
  210. end;
  211.  
  212. // ------------ Main Function ------------ //
  213. begin
  214. initialize();
  215. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement