Advertisement
Guest User

Untitled

a guest
May 14th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.68 KB | None | 0 0
  1. program AIOFighter;
  2. {$DEFINE SMART}
  3. {$i AeroLib/AeroLib.Simba}
  4. {$i Reflection/Reflection.Simba}
  5.  
  6. const
  7. ScriptVersion = '0.2';
  8. Player_Username = '4';
  9. Player_Password = '3';
  10.  
  11. var
  12. LocP: TReflectLocalPlayer;
  13. OgreCount, TotalSlayed: Integer;
  14. swordfish, randomHP, lobster, x, y, tuna, trout, salmon, shark, food, currentFood: integer;
  15. FoodDTMs: TIntegerArray;
  16. randomEnergy: Integer;
  17.  
  18. procedure HandleLogin;
  19. begin
  20. if (not isLoggedIn()) then
  21. LocP.Login;
  22. if (isLoggedIn()) then
  23. begin
  24. exit;
  25. end;
  26. end;
  27.  
  28. procedure setVars;
  29. begin
  30. LocP.Username := Player_Username;
  31. LocP.Password := Player_Password;
  32. LocP.Active := True;
  33. end;
  34.  
  35. function MouseOnScreen: boolean;
  36. begin
  37. Result := PointInBox(getMousePnt, IntToBox(0, 0, 760, 500));
  38. end;
  39.  
  40. procedure mouseOffScreen;
  41. begin
  42. if MouseOnScreen then
  43. MMouseOffClient('rand');
  44. end;
  45.  
  46. procedure mightOffScreen;
  47. begin
  48. if Random(10) = 0 then
  49. mouseOffScreen;
  50. end;
  51.  
  52. procedure randomCompass;
  53. var
  54. Keys: TIntegerArray;
  55. I: Integer;
  56. begin
  57. if (not locP.isLoggedIn) then
  58. Exit;
  59. Keys := [VK_RIGHT, VK_LEFT];
  60. I := Random(2);
  61. Wait(100 + random(50));
  62. KeyDown(Keys[I]);
  63. Wait(500 + random(1000));
  64. KeyUp(Keys[I]);
  65. Wait(200 + random(350));
  66. end;
  67.  
  68. function GotFood: boolean;
  69. var
  70. x, y, z: integer;
  71. begin
  72. GameTab(tab_inv);
  73. wait(randomrange(200, 600));
  74. for z := 0 to high(FoodDTMs) do
  75. if findDTM(FoodDTMs[z], x, y, 524, 176, 737, 470) then
  76. begin
  77. Result := true;
  78. exit;
  79. end;
  80. end;
  81.  
  82. procedure customMouse(point: TPoint);
  83. begin
  84. case random(0, 6) of
  85. 0..2: BrakeMMouse(point, random(3), random(3), true);
  86. 3: BrakeMMouse(point, random(3), random(3), false);
  87. 4..5: MissMouse(point, random(3), random(3));
  88. 6: HumanMMouse(point, random(3), random(3));
  89. end;
  90. end;
  91.  
  92. procedure afterClick;
  93. begin
  94. case Random(20) of
  95. 4..6: randomCompass;
  96. 9..15: SleepAndMoveMouse(200 + Random(2000));
  97. 16..19: mouseOffScreen;
  98. end;
  99. end;
  100.  
  101. procedure randomAngleMM();
  102. var
  103. leftSide, rightSide: TBox;
  104. boxArray: array of TBox;
  105. endPoint: TPoint;
  106. I: Integer;
  107. begin
  108. leftSide := intToBox(9, 9, 360, 480);
  109. rightSide := intToBox(361, 9, 720, 480);
  110. boxArray := [leftSide, rightSide];
  111. I := random(0, 1);
  112. mouseBox(boxArray[I], MOUSE_MOVE);
  113. sleep(random(40, 600));
  114. getMousePos(x, y);
  115. if (pointInBox(Point(x, y), leftSide)) then
  116. endPoint := Point(x + 80 + random(1, 340), y + random(9, 19))
  117. else
  118. endPoint := Point(x - 80 - random(1, 340), y + random(9, 19));
  119. HoldMouse(x, y, MOUSE_MIDDLE);
  120. customMouse(endPoint);
  121. sleep(random(1, 30));
  122. ReleaseMouse(x, y, MOUSE_MIDDLE);
  123. end;
  124.  
  125. procedure setPlayer;
  126. begin
  127. LocP.Login;
  128. Wait(1000 + Random(1500));
  129. Reflect.Compass.MakePitch(10);
  130. end;
  131.  
  132. procedure AntiBan;
  133. begin
  134. case random(30000) of
  135. 0..50: BoredHuman;
  136. 51..55: HoverSkill('Strength', False);
  137. 56..60: HoverSkill('Hitpoints', False);
  138. 61..70: pickUpMouse();
  139. 71..500: MMouseOffClient('random');
  140. 501..750: compassMovement(10, 160, False);
  141. 751..1000: randomAngleMM();
  142. end;
  143. end;
  144.  
  145. procedure Debug(DebugSTR: string);
  146. begin
  147. WriteLn(DebugSTR);
  148. end;
  149.  
  150. procedure waitRandom;
  151. begin
  152. case random(1000) of
  153. 0..700: waitEx(RandomRange(400, 1000));
  154. 701..900: waitEx(RandomRange(1600, 2600));
  155. 901..1000: waitEx(RandomRange(1800, 3800));
  156. end;
  157. end;
  158.  
  159. procedure randomMouseInput(pnt: Tpoint; ranx, rany: integer);
  160. begin
  161. case random(3) of
  162. 0: humanMMouse(pnt, ranx, rany);
  163. 1: missMouse(pnt, ranx, rany);
  164. 2: mouse(pnt, ranx, rany, mouse_move);
  165. end;
  166. end;
  167.  
  168. function R_TileOnMS(Tile: TPoint; var OutputPoint: TPoint; x: integer = 0; y: integer = 0; z: integer = 0): boolean;
  169. var
  170. tempB: TBox;
  171. begin
  172. OutputPoint := TReflectionTiles.TileToMS(Tile, x, y, z);
  173. tempB := intToBox(MSX1, MSY1, MSX2, MSY2);
  174. result := PointInBox(OutputPoint, tempB);
  175. end;
  176.  
  177. function R_InteractTile(tile: Tpoint; action: string; x: integer = 0; y: integer = 0; z: integer = 0): boolean;
  178. var
  179. RSTile: TPoint;
  180. begin
  181. if not R_TileOnMS(Tile, RSTile, x, y, z) then
  182. begin
  183. locP.WalkToTileMM(Tile);
  184. Wait(100 + Random(200));
  185. FFlag(0);
  186. Exit;
  187. end;
  188. if R_TileOnMS(Tile, RSTile, x, y, z) then
  189. begin
  190. randomMouseInput(rsTile, 3, 3);
  191. if (Reflect.Text.IsUpText(action)) then
  192. begin
  193. FastClick(mouse_left);
  194. result := didClick(true, 1000);
  195. afterClick;
  196. Wait(1000 + Random(200));
  197. end
  198. else
  199. begin
  200. if TReflectionText.OptionExists(action) then
  201. begin
  202. FastClick(mouse_right);
  203. result := Reflect.Text.ChooseOption(action);
  204. afterClick;
  205. Wait(1000 + Random(200));
  206. end;
  207. if not result then
  208. exit;
  209. end;
  210. end;
  211. end;
  212.  
  213. procedure dismissAllRandoms;
  214. var
  215. i, j, me_indice: integer;
  216. _npcs: TReflectNPCArray;
  217. randoms: tstringarray;
  218. begin
  219. randoms := ['molly', 'niles', 'miles', 'giles', 'sandwich lady', 'drunken dwarf', 'genie', 'highwayman', 'dr jekyll', 'cap' 'n hand', 'security guard', 'rick turpentine', 'mysterious old man', 'frog', 'null', 'mime', 'sergeant damien', 'freaky forester', 'postie pete', 'tilt', 'flippa', 'leo', 'pillory guard', 'evil bob'];
  220. _npcs.GetAll;
  221. me_indice := TReflectLocalPlayer.GetPlayerIndex;
  222. for i := 0 to high(_npcs) do
  223. begin
  224. if (_npcs[i].getInteractingIndex = me_indice) then
  225. begin
  226. for j := 0 to high(randoms) do
  227. begin
  228. if (pos(randoms[j], lowercase(_npcs[i].getName)) > 0) then
  229. begin
  230. if R_InteractTile(_npcs[i].getTile, 'Dismiss', 0, 0, 50) then
  231. begin
  232. sleep(2500 + random(1000));
  233. writeln('Dismissed random: ' + _npcs[i].getname + ' Time Running: ' + TimeRunning);
  234. end;
  235. end;
  236. end;
  237. end;
  238. end;
  239. end;
  240.  
  241. function Attack: boolean;
  242. var
  243. NPCs: TReflectNPCArray;
  244. I: Integer;
  245. begin
  246. Wait(200 + Random(200));
  247. NPCs.Get('Chicken');
  248. for I := 0 to High(NPCs) do
  249. if (NPCs[I].GetInteractingIndex = - 1) and (NPCs[I].GetMaxHealth = 0) then
  250. begin
  251. Result := R_InteractTile(NPCs[I].GetTile, 'Attack', mouse_Right);
  252. Exit;
  253. end;
  254. end;
  255.  
  256. procedure checkRun;
  257. begin
  258. if ((not locp.IsRunOn()) and (locp.GetRunEnergy() > randomEnergy)) then
  259. begin
  260. toggleRunning(true);
  261. end;
  262. end;
  263.  
  264. procedure WaitFight;
  265. begin
  266. while (LocP.GetInteractingIndex > 0) or LocP.ismoving do
  267. begin
  268. Wait(20 + Random(20));
  269. handlelogin;
  270. dismissAllRandoms;
  271. end;
  272. end;
  273.  
  274. begin
  275. InitAL();
  276. Reflect.Setup;
  277. LocP.Create;
  278. setVars;
  279. setPlayer;
  280. mouseSpeed := Random(20, 40);
  281. repeat
  282. dismissAllRandoms;
  283. handlelogin;
  284. Attack();
  285. waitFight;
  286. until (false);
  287. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement