Advertisement
Guest User

Untitled

a guest
Nov 6th, 2016
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.35 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. // Declaring functions
  77. procedure sambuka; forward;
  78.  
  79. procedure configurate()
  80. begin
  81. SetDesktopAsClient();
  82. MoveMouse(0, 0);
  83.  
  84. account.username := '';
  85. account.password := ';
  86. account.online := false;
  87. account.inventory_full := false;
  88.  
  89. cursor.x := 0;
  90. cursor.y := 0;
  91.  
  92. osrs.running := false;
  93. end;
  94.  
  95. //system include
  96. // ------------ Start OSRS ------------ //
  97. Function startOsrs(): Boolean;
  98. begin
  99. execute();
  100.  
  101. repeat
  102. if (FindAndSetTarget('Old School RuneScape', true) = True) then
  103. begin
  104. console(['loaded - osrs.exe']);
  105. osrs.running := true;
  106. end
  107. until(osrs.running = true);
  108. end;
  109.  
  110. // ------------ Check All Running Processes ------------ //
  111. Function checkOsrsRunning(): Boolean;
  112. var running: boolean;
  113. begin
  114. running := FindAndSetTarget('Old School RuneScape', true);
  115.  
  116. if (running = True) then
  117. begin
  118. console(['osrs.exe is running']);
  119. end
  120. else
  121. begin
  122. console(['starting osrs.exe']);
  123. startOsrs();
  124. end;
  125.  
  126. GetClientDimensions(screen.x, screen.y);
  127. screen.x := 764-1;
  128. screen.y := 502-1;
  129. console(['size: ', screen.x, 'x', screen.y]);
  130. MouseSetClientArea(33, 36, 797, 538);
  131. ImageSetClientArea(33, 36, 797, 538);
  132. end;
  133.  
  134. procedure doPage(page: integer)
  135. begin
  136. case page of
  137. 1: begin
  138. console(['page - loading']);
  139. end
  140. 2: begin
  141. console(['page - welcome']);
  142. clickButton('existing_user', 125, 30);
  143. end
  144. 3: begin
  145. console(['page - Not a member']);
  146. clickButton('switch_world', 90, 25);
  147. end
  148. 4: begin
  149. console(['page - worlds']);
  150. clickButton('w_394', 80, 15);
  151. clickButton('login', 125, 32);
  152. end
  153. 5: begin
  154. console(['page - start']);
  155. clickButton('play', 220, 80);
  156. end
  157. 6: begin
  158. console(['page - Bad username or password']);
  159. clickButton('try_again', 125, 30);
  160. clickButton('cancel', 125, 30);
  161. end;
  162. 7: begin
  163. console(['page - login']);
  164. typeText(account.username);
  165. Wait(250+Random(250));
  166.  
  167. PressKey(13);
  168. Wait(250+Random(500));
  169.  
  170. console(['Typing password']);
  171. typeText(account.password);
  172. Wait(500+Random(500));
  173.  
  174. clickButton('login', 125, 30);
  175. end;
  176. end;
  177. end;
  178.  
  179. // ------------ Initialize ------------ //
  180. Function initialize(): Boolean;
  181. begin
  182. configurate();
  183. setDTM();
  184. checkOsrsRunning();
  185.  
  186. repeat
  187. osrs.page := determinePage();
  188. if (osrs.page = 0) then // Game screen
  189. begin
  190. if (testing = true) then
  191. begin
  192. if (walker_set = false) then
  193. begin
  194. RSW_test.Init(w_getClientPID());
  195. RSW_test.UpdateMap(True);
  196. walker_set := true;
  197. end;
  198.  
  199. RSW_test.DebugPos(loc);
  200. end
  201. else
  202. begin
  203. sambuka;
  204. end;
  205. end
  206. else
  207. begin // Login screen
  208. doPage(osrs.page);
  209. end;
  210.  
  211. wait(Random(800));
  212. until(bot_loop = false);
  213. end;
  214.  
  215. // ------------ Main Function ------------ //
  216. begin
  217. initialize();
  218. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement