Advertisement
Guest User

air orb

a guest
May 27th, 2016
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.29 KB | None | 0 0
  1. program AirOrbCrafter; //this 1
  2. {$DEFINE SMART}
  3. {$I AEROLIB/AEROLIB.SIMBA}
  4. {$i Reflection/Reflection.Simba}
  5.  
  6. const
  7. User = 'hijackers_teamyaks@hotmail.com';
  8. Pass = 'killer12';
  9. Pin = '1970';
  10. foodtype = 'Lobster';
  11. foodtoTake = 1;
  12. eatPercent = 70;
  13. OrbPosition := point (254 + random( - 30, 30), 415 + random( - 30, 30));
  14.  
  15. var
  16. x, y, lor, ladder, randomsdismissed, orbs, profit, startXp, CurrentxP, randomEnergy: integer;
  17. myplayer: treflectlocalplayer;
  18. tim, tim2: Timer;
  19. position: TPoint;
  20. Opened, changeglory: boolean;
  21. doorbox: Tcheckbox;
  22. edgetobank, banktotrapdoor, LadderToLadder: tpointarray;
  23. depleted: boolean;
  24.  
  25. function GetWordsEx(text, wordCharacters: string): TStringArray; //thanks Janilabo
  26. var
  27. l, i, r: Integer;
  28. begin
  29. l := Length(text);
  30. if ((l > 0) and (wordCharacters <> '')) then
  31. begin
  32. SetLength(Result, l);
  33. for i := 1 to l do
  34. if (Pos(text[i], wordCharacters) > 0) then
  35. begin
  36. Result[r] := text[i];
  37. for i := (i + 1) to l do
  38. if (Pos(text[i], wordCharacters) > 0) then
  39. Result[r] := (Result[r] + text[i])
  40. else
  41. Break;
  42. Inc(r);
  43. end;
  44. end;
  45. SetLength(Result, r);
  46. end;
  47.  
  48. function getPriceGE(id : integer) : integer; //thx hoodz and flight!
  49. var sellSource, webSource : string;
  50. i : integer;
  51. _strings : TStringArray;
  52. begin
  53. try
  54. webSource := getPage('http://services.runescape.com/m=itemdb_oldschool/viewitem?obj='+intToStr(id));
  55. except
  56. //daLogger.Warn('Failed to connect to grand exchange database', []);
  57. exit;
  58. end;
  59. sellSource := between('<h3>Current Guide Price <span title=''', '''', webSource);
  60. _strings := GetWordsEx(sellSource, '0123456789');
  61.  
  62. sellSource := '';
  63. if length(_strings) > 0 then
  64. for i:=0 to high(_strings) do
  65. sellSource := sellSource+_strings[i];
  66.  
  67. if (Length(sellSource) > 0) then
  68. result := strToInt(sellSource)
  69. else
  70. //daLogger.Warn('Failed to get grand exchange price for item ID: '+intToStr(id), []);
  71. end;
  72.  
  73. procedure CalcOrbsMade();
  74. begin
  75. Orbs := round((CurrentXp - StartXp)/76);
  76. end;
  77.  
  78. procedure CalcProfit();
  79. begin
  80. profit := (getPriceGE(573)-getPriceGE(567)-(3*getPriceGE(564)));
  81. end;
  82.  
  83. procedure Proggy();
  84. var
  85. PlankPH, GPPH, GP, XP, XPPH: Integer;
  86. begin
  87. CalcOrbsMade();
  88. PlankPH := Round((Orbs * 3600) / (GetTimeRunning / 1000));
  89. GP := Round(Orbs * profit);
  90. GPPH := Round(((GP) * 3600) / (GetTimeRunning / 1000));
  91. XP := (CurrentXp - StartXp);
  92. XPPH := Round(((XP) * 3600) / (GetTimeRunning / 1000));
  93. OS_Smart.__Graphics.Clear;
  94. OS_Smart.__Graphics.DrawClippedText('JS Air Orber', 'StatChars', point(440, 325), clwhite);
  95. OS_Smart.__Graphics.DrawClippedText('Run Time : ' + TimeRunning, 'StatChars', point(10, 30), clWhite);
  96. OS_Smart.__Graphics.DrawClippedText('Orbs Made : ' + IntToStr(orbs) + ' ('+ IntToStr(PlankPH) + ')', 'StatChars', point(10, 50), clWhite);
  97. OS_Smart.__Graphics.DrawClippedText('GP Made : ' + IntToStr(GP) + ' ('+ IntToStr(GPPH) + ')' , 'StatChars', point(10, 70), clWhite);
  98. OS_Smart.__Graphics.DrawClippedText('XP Gained : ' + IntToStr(XP) + ' ('+ IntToStr(XPPH) + ')' , 'StatChars', point(10, 90), clWhite);
  99. end;
  100.  
  101. function randomEnergyGenerate(): Integer;
  102. begin
  103. result := random(15, 85);
  104. end;
  105.  
  106. function canRun(): boolean;
  107. begin
  108. result := ((myplayer.GetRunEnergy > 0) and (not myplayer.IsRunOn));
  109. end;
  110.  
  111. procedure checkRun();
  112. begin
  113. if ((canRun()) and (getRunEnergy() > randomEnergy)) then
  114. begin
  115. toggleRunning(true);
  116. randomEnergyGenerate();
  117. end;
  118. end;
  119.  
  120. procedure Login();
  121. begin
  122. MyPlayer.Login;
  123. wait(randomRange(1000, 4000));
  124. checkrun;
  125. setangle(0);
  126. end;
  127.  
  128. procedure SetUp();
  129. begin
  130. MyPlayer.Username := user;
  131. MyPlayer.Password := pass;
  132. MyPlayer.Active := True;
  133. Me.Member := true;
  134. MyPlayer.Create;
  135. if (not myplayer.isLoggedIn()) then
  136. Login();
  137. setAngle(0);
  138. CalcProfit();
  139. StartXp := MyPlayer.GetSkillExp(SKILL_MAGIC);
  140. randomEnergy := randomEnergyGenerate();
  141. BankToTrapDoor := [Point(3092 + random( - 1, 1), 3484 + random( - 1, 1)), Point(3094 + random( - 1, 1), 3476 + random( - 1, 1)), Point(3094, 3472)];
  142. LadderToLadder := [Point(3097 + random( - 1, 1), 9876 + random( - 1, 1)), Point(3095 + random( - 1, 1), 9885 + random( - 1, 1)), Point(3095 + random( - 1, 1), 9895 + random( - 1, 1)), Point(3096 + random( - 1, 1), 9903 + random( - 1, 1)), Point(3102 + random( - 1, 1), 9909 + random( - 1, 1)), Point(3107 + random( - 1, 1), 9909 + random( - 1, 1)), Point(3116 + random( - 1, 1), 9909 + random( - 1, 1)), Point(3124 + random( - 1, 1), 9909 + random( - 1, 1)), Point(3131 + random( - 1, 1), 9915 + random( - 1, 1)), Point(3132 + random( - 1, 1), 9926 + random( - 1, 1)), Point(3133 + random( - 1, 1), 9935 + random( - 1, 1)), Point(3133 + random( - 1, 1), 9943 + random( - 1, 1)), Point(3124 + random( - 1, 1), 9950 + random( - 1, 1)), Point(3116 + random( - 1, 1), 9957 + random( - 1, 1)), Point(3107 + random( - 1, 1), 9954 + random( - 1, 1)), Point(3097 + random( - 1, 1), 9956 + random( - 1, 1)), Point(3089 + random( - 1, 1), 9960 + random( - 1, 1)), Point(3088 + random( - 1, 1), 9970 + random( - 1, 1))];
  143. end;
  144.  
  145. function GotAirOrbs: boolean;
  146. begin
  147. result := TReflectionInventory.Contains(['Air orb'])
  148. end;
  149.  
  150. function GotUnpOrbs(): boolean;
  151. begin
  152. result := TReflectionInventory.Contains(['Unpowered orb']);
  153. end;
  154.  
  155. function GotCosmics(): Boolean;
  156. var
  157. Cosmics: TReflectInvItem;
  158. foundCosmics: boolean;
  159. i: integer;
  160. CosmicID: TIntegerArray;
  161. begin
  162. CosmicID := [564];
  163. for i := 0 to high(CosmicID) do
  164. begin
  165. if Cosmics.Find(CosmicID[i]) then
  166. begin
  167. foundCosmics := true;
  168. result := true;
  169. break;
  170. end;
  171. end;
  172. if ((not foundCosmics) or (Cosmics.getQuantity < 2)) then
  173. result := false
  174. end;
  175.  
  176. procedure customMouse(point: TPoint);
  177. begin
  178. case random(0, 9) of
  179. 0..2: BrakeMMouse(point, random(5), random(5), true);
  180. 3: BrakeMMouse(point, random(5), random(5), false);
  181. 4..7: MissMouse(point, random(5), random(5));
  182. 8..9: HumanMMouse(point, random(5), random(5));
  183. end;
  184. end;
  185.  
  186. procedure randomMovementEdit();
  187. var
  188. I: Integer;
  189. Deg: Extended;
  190. Keys: TIntegerArray;
  191. begin
  192. if not isLoggedIn() then
  193. exit;
  194. Keys := [VK_RIGHT, VK_LEFT];
  195. I := Random(2);
  196. if (Random(2) = I) then
  197. begin
  198. Deg := getCompassAngle();
  199. Wait(100 + random(50));
  200. KeyDown(Keys[I]);
  201. Wait(500 + random(1000));
  202. KeyUp(Keys[I]);
  203. Wait(500 + random(1000));
  204. end
  205. else if (Random(3) = 0) then
  206. sleepAndMoveMouse(1000 + random(200));
  207. end;
  208.  
  209. procedure randomAngleMM();
  210. var
  211. leftSide, rightSide: TBox;
  212. boxArray: array of TBox;
  213. endPoint: TPoint;
  214. I: Integer;
  215. begin
  216. leftSide := intToBox(9, 9, 360, 480);
  217. rightSide := intToBox(361, 9, 720, 480);
  218. boxArray := [leftSide, rightSide];
  219. I := random(0, 1);
  220. mouseBox(boxArray[I], MOUSE_MOVE);
  221. sleep(random(40, 600));
  222. getMousePos(x, y);
  223. if (pointInBox(Point(x, y), leftSide)) then
  224. endPoint := Point(x + 80 + random(1, 340), y + random(9, 19))
  225. else
  226. endPoint := Point(x - 80 - random(1, 340), y + random(9, 19));
  227. HoldMouse(x, y, MOUSE_MIDDLE);
  228. customMouse(endPoint);
  229. sleep(random(1, 30));
  230. ReleaseMouse(x, y, MOUSE_MIDDLE);
  231. end;
  232.  
  233. procedure RandomWait;
  234. begin
  235. case random(1000) of
  236. 0..700: Wait(RandomRange(800, 1300));
  237. 701..900: Wait(RandomRange(400, 1600));
  238. 901..1000: Wait(RandomRange(800, 2800));
  239. end;
  240. end;
  241.  
  242. function MouseOnScreen: boolean;
  243. begin
  244. Result := PointInBox(getMousePnt, IntToBox(0, 0, 760, 500));
  245. end;
  246.  
  247. procedure mouseOffScreen;
  248. begin
  249. if MouseOnScreen then
  250. MMouseOffClient('rand');
  251. end;
  252.  
  253. procedure randomCompass();
  254. var
  255. Keys: TIntegerArray;
  256. I: Integer;
  257. begin
  258. if (not MyPlayer.isLoggedIn) then
  259. Exit;
  260. Keys := [VK_RIGHT, VK_LEFT];
  261. I := Random(2);
  262. Wait(100 + random(50));
  263. KeyDown(Keys[I]);
  264. Wait(500 + random(1000));
  265. KeyUp(Keys[I]);
  266. Wait(200 + random(350));
  267. end;
  268.  
  269. procedure Antiban();
  270. begin
  271. if (random(0, 60) = 0) then
  272. case random(0, 33) of
  273. 0: HoverSkill('random', False);
  274. 1..3: HoverSkill('magic', False);
  275. 3..6: PickUpMouse();
  276. 7: RandomCompass();
  277. 8..10: MMouseOffClient('random');
  278. 11: examineInv();
  279. 12..13: randomFKeys(True);
  280. 14: randomRClick();
  281. 15: checkMovingObjs(true);
  282. 16..19: pickUpMouse();
  283. 20..22: RandomAngleMM();
  284. 23..25: SleepAndMoveMouse(200 + Random(800));
  285. 26..30: boredhuman;
  286. 31..33: randomMovementEdit();
  287. end;
  288. end;
  289.  
  290. procedure Anticlick();
  291. begin
  292. if (random(0, 3) = 0) then
  293. case random(0, 24) of
  294. 0..2: randomCompass;
  295. 3..15: SleepAndMoveMouse(75 + Random(750));
  296. 16..19: mouseOffScreen;
  297. 20..24: Antiban();
  298. end;
  299. end;
  300.  
  301. procedure eatFood;
  302. var
  303. Food: TReflectInvItem;
  304. Point: TPoint;
  305. begin
  306. if (not TReflectionInventory.Contains([foodtype])) then
  307. exit;
  308. gametab(tab_inv) if food.Find(FOODTYPE) then
  309. begin
  310. Point := Food.GetMSPoint;
  311. reflect.mouse.move(Point, randomrange(2, 4), randomrange(2, 4));
  312. FastClick(MOUSE_LEFT);
  313. wait(300);
  314. end
  315. end;
  316.  
  317. function NearSewer(): boolean;
  318. begin
  319. Result := Reflect.Tiles.NearTile(Point(3097, 9884), 80);
  320. end;
  321.  
  322. function NearBank(): boolean;
  323. begin
  324. Result := Reflect.Tiles.NearTile(Point(3094, 3493), 6);
  325. end;
  326.  
  327. function NearEdge(): boolean;
  328. begin
  329. Result := Reflect.Tiles.NearTile(Point(3087, 3496), 2);
  330. end;
  331.  
  332. function NearGate(): boolean;
  333. begin
  334. result := Reflect.Tiles.NearTile(Point(3102, 9910), 4);
  335. end;
  336.  
  337. function neargate2():boolean;
  338. begin
  339. Result := Reflect.Tiles.NearTile(Point(3130, 9916), 2) or Reflect.Tiles.NearTile(Point(3133, 9916), 2);
  340. end;
  341.  
  342. function NearLadder(): boolean;
  343. begin
  344. Result := Reflect.Tiles.NearTile(Point(3088, 9970), 5);
  345. end;
  346.  
  347. function NearOrbs(): boolean;
  348. begin
  349. Result := Reflect.Tiles.NearTile(Point(3088, 3570), 10);
  350. end;
  351.  
  352. function NearDemons(): boolean;
  353. begin
  354. Result := Reflect.Tiles.NearTile(Point(3097, 9956), 14);
  355. end;
  356.  
  357. function NearTrapdoor(): boolean;
  358. begin
  359. Result := Reflect.Tiles.NearTile(Point(3094, 3470), 6);
  360. end;
  361.  
  362. procedure randomMouseInput(pnt: Tpoint; ranx, rany: integer);
  363. begin
  364. case random(3) of
  365. 0: humanMMouse(pnt, ranx, rany);
  366. 1: missMouse(pnt, ranx, rany);
  367. 2: mouse(pnt, ranx, rany, mouse_move);
  368. end;
  369. end;
  370.  
  371. function R_TileOnMS(Tile: TPoint; var OutputPoint: TPoint; x: integer = 0; y: integer = 0; z: integer = 0): boolean;
  372. var
  373. tempB: TBox;
  374. begin
  375. OutputPoint := TReflectionTiles.TileToMS(Tile, x, y, z);
  376. tempB := intToBox(MSX1, MSY1, MSX2, MSY2);
  377. result := PointInBox(OutputPoint, tempB);
  378. end;
  379.  
  380. function R_InteractTile(tile: Tpoint; action: string; x: integer = 0; y: integer = 0; z: integer = 0): boolean;
  381. var
  382. RSTile: TPoint;
  383. begin
  384. case random(2) of
  385. 0: lor := vk_right;
  386. 1: lor := vk_left;
  387. end;
  388. if not R_TileOnMS(Tile, RSTile, x, y, z) then
  389. begin
  390. MyPlayer.WalkToTileMM(Tile);
  391. Wait(100 + Random(200));
  392. FFlag(0);
  393. Exit;
  394. end;
  395. if R_TileOnMS(Tile, RSTile, x, y, z) then
  396. begin
  397. randomMouseInput(rsTile, 3, 3);
  398. if (Reflect.Text.IsUpText(action)) then
  399. begin
  400. FastClick(mouse_left);
  401. result := didClick(true, 1000);
  402. Wait(50 + Random(200));
  403. end
  404. else
  405. begin
  406. if TReflectionText.OptionExists(action) then
  407. begin
  408. FastClick(mouse_right);
  409. result := TReflectionText.ChooseOption(action);
  410. Wait(50 + Random(200));
  411. end;
  412. if not result then
  413. begin
  414. keyDown(lor);
  415. Wait(randomRange(200, 500));
  416. keyUp(lor);
  417. end;
  418. end;
  419. end;
  420. end;
  421.  
  422. procedure HandleRandoms;
  423. var
  424. i, j, me_indice: integer;
  425. _npcs: TReflectNPCArray;
  426. randoms: tstringarray;
  427. begin
  428. randoms := ['molly', 'stranger plant', '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'];
  429. _npcs.GetAll;
  430. me_indice := TReflectLocalPlayer.GetPlayerIndex;
  431. for i := 0 to high(_npcs) do
  432. begin
  433. if (_npcs[i].getInteractingIndex = me_indice) then
  434. begin
  435. for j := 0 to high(randoms) do
  436. begin
  437. if (pos(randoms[j], lowercase(_npcs[i].getName)) > 0) then
  438. begin
  439. if R_InteractTile(_npcs[i].getTile, 'Dismiss', 0, 0, 50) then
  440. begin
  441. randomsdismissed = randomsdismissed + 1;
  442. antiClick;
  443. sleep(2500 + random(1000));
  444. end;
  445. end;
  446. end;
  447. end;
  448. end;
  449. end;
  450.  
  451. function findObject(COL, TOL, PIXELS: Integer; HUE, SAT: Extended): Boolean;
  452. var
  453. WhatEver: TColEx;
  454. TPA: TPointArray;
  455. ATPA: T2DPointArray;
  456. I: Integer;
  457. box: TBox;
  458. x, y: Integer;
  459. begin
  460. WhatEver.Create(Col, Tol, Hue, Sat);
  461. if not WhatEver.FindAllIn(Area_MS, TPA) then
  462. Exit(False);
  463. ATPA := ClusterTPA(TPA, 10);
  464. SortATPAFromMidPoint(ATPA, Point(MSCX, MSCY));
  465. if (length(ATPA) <= 0) then
  466. begin
  467. result := False;
  468. exit;
  469. end;
  470. for I := 0 to high(ATPA) do
  471. begin
  472. if (length(ATPA[I]) >= PIXELS) then
  473. begin
  474. box := intToBox(ATPA[I].getBounds().X1, ATPA[I].getBounds().Y1 - 25, ATPA[I].getBounds().X2, ATPA[I].getBounds().Y2);
  475. if (box.x1 < 0) then
  476. box.x1 := 0;
  477. if (box.y1 < 0) then
  478. box.y1 := 0;
  479. position := MiddleTPA(ATPA[I]);
  480. result := True;
  481. exit;
  482. end;
  483. end;
  484. result := False;
  485. end;
  486.  
  487.  
  488. procedure walkWait();
  489. var
  490. I: Integer;
  491. begin
  492. repeat
  493. Wait(200 + Random(200));
  494. until (not MyPlayer.IsMoving);
  495. Wait(250 + Random(600));
  496. end;
  497.  
  498. procedure openGate();
  499. begin
  500. walkWait();
  501. if not Myplayer.isloggedin() then
  502. exit;
  503. if (not neargate) and (not neargate2) then
  504. exit;
  505. if (findObject(7763841, 10, 40, 0.16, 0.12)) then
  506. begin
  507. customMouse(position);
  508. if TReflectionText.IsUpText('Close') then
  509. exit;
  510. if TReflectionText.IsUpText('Open') then
  511. begin
  512. fastClick(mouse_left);
  513. Wait(700 + random(300));
  514. end
  515. else
  516. begin
  517. fastClick(mouse_right);
  518. Wait(50 + random(100));
  519. if TReflectionText.ChooseOption('Open') then
  520. Wait(700 + random(300))
  521. else begin randomCompass();
  522. openGate(); end;
  523. end;
  524. end
  525. else
  526. begin
  527. randomCompass();
  528. openGate();
  529. end;
  530. AntiClick();
  531. end;
  532.  
  533. function walkPath(Path: TPointArray; reverse: boolean = false): boolean;
  534. var
  535. I, H, Tim, D, Fails, lP, z, run: integer;
  536. P, MM, MMF: TPoint;
  537. t: Timer;
  538. begin
  539. ColorToleranceSpeed(1);
  540. H := High(Path);
  541. Tim := GetSystemTime + 10000 + Random(2000);
  542. Fails := 0;
  543. lP := 0;
  544. repeat
  545. if not MyPlayer.isloggedin() then
  546. exit;
  547. Proggy();
  548. HandleRandoms();
  549. for I := H downto 0 do
  550. begin
  551. MM := TReflectionTiles.TileToMM(path[I]);
  552. D := Distance(MM.X, MM.Y, MMCX, MMCY);
  553. if (d < random(60, 67)) then
  554. begin
  555. if (d >= 10) then
  556. begin
  557. CustomMouse(MM);
  558. if random(1000) > 34 then
  559. FastClick(mouse_left)
  560. else
  561. begin
  562. fastclick(mouse_left);
  563. wait(randomrange(20, 70));
  564. fastclick(mouse_left);
  565. end;
  566. WaitFunc(@ isplayerWalking, 10, 1350);
  567. if (getHealthPercent <= eatpercent) then
  568. begin
  569. eatFood;
  570. if canRun then
  571. ToggleRunning(true)
  572. end;
  573. if (NearDemons() and canRun()) then
  574. ToggleRunning(true);
  575. if (not myplayer.ismoving) and (neargate) then
  576. openGate();
  577. if (neargate2) then
  578. openGate();
  579. case Random(1800) of
  580. 4..90: compassMovement(random(5, 15), igaussrange(90, 150), false);
  581. 92..135: SleepAndMoveMouse(200 + Random(600));
  582. 136..149: MMouseOffClient('random');
  583. 150..155: randomRclick();
  584. 156..170: randomAngleMM();
  585. 176..185:
  586. if canRun then
  587. ToggleRunning(true);
  588. 186..300: antiClick;
  589. end;
  590. end;
  591. WaitFunc(@ isplayerWalking, 10, 700);
  592. if (getHealthPercent <= eatPercent) then
  593. begin
  594. eatFood;
  595. if canRun then
  596. ToggleRunning(true);
  597. end;
  598. if (i = h) then
  599. fflag(8)
  600. else
  601. fflag(10 + random(25));
  602. Result := (I = H);
  603. if result then
  604. break(2)
  605. else
  606. break();
  607. end;
  608. end;
  609. Result := (I = H);
  610. until result;
  611. FFlag(5 + randomrange( - 2, 2));
  612. wait(randomrange(400, 700));
  613. end;
  614.  
  615. procedure upLadder();
  616. begin
  617. repeat
  618. if not MyPlayer.isloggedin() then
  619. exit;
  620. HandleRandoms;
  621. if R_InteractTile([3088, 9971], 'Ladder', mouse_left) then
  622. begin
  623. sleep(1500);
  624. while myplayer.isMoving do
  625. sleep(300 + random(800));
  626. waitfunc(@ nearOrbs, 50, 4000);
  627. end;
  628. until (nearOrbs);
  629. end;
  630.  
  631. procedure openDoor();
  632. begin
  633. repeat
  634. if not MyPlayer.isloggedin() then
  635. exit;
  636. HandleRandoms;
  637. if R_InteractTile([3097, 3468], 'Trapdoor', mouse_left) then
  638. begin
  639. sleep(1500);
  640. while myplayer.isMoving do
  641. sleep(500 + random(1000));
  642. waitfunc(@ nearSewer, 50, 1500);
  643. end;
  644. until (NearSewer);
  645. end;
  646.  
  647. procedure ToTrapDoor;
  648. begin
  649. if (not NearTrapdoor) then
  650. begin
  651. walkPath(BankToTrapDoor);
  652. walkWait();
  653. end;
  654. end;
  655.  
  656. procedure ToLadder;
  657. begin
  658. if (not NearLadder) then
  659. begin
  660. WalkPath(LadderToLadder);
  661. walkWait();
  662. end;
  663. end;
  664.  
  665. function OrbtextVisible(): Boolean;
  666. var
  667. t: Timer;
  668. numb: Integer;
  669. begin
  670. result := false;
  671. numb := random(2000, 3000);
  672. t.start();
  673. repeat
  674. if (t.timeElapsed() > numb) then
  675. break;
  676. sleep(random(320, 600));
  677. if (countColor(128, 256, 359, 289, 379) > 20) then
  678. result := true;
  679. until (result);
  680. end;
  681.  
  682. function IsItemEquipped(Name: string): Boolean;
  683. var
  684. i: Integer;
  685. Items: TReflectWornEquipmentArray;
  686. begin
  687. Items.GetAll();
  688. for i := 0 to High(Items) do
  689. begin
  690. if Pos(Name, Items[i].GetName()) > 0 then
  691. Exit(True);
  692. end
  693. end;
  694.  
  695. procedure checkGlory();
  696. begin
  697. if IsItemEquipped('Amulet of glory(') then
  698. begin
  699. depleted := false;
  700. end
  701. else
  702. depleted := true;
  703. end;
  704.  
  705. procedure WithdrawItems(item: string; amount: Integer; Result: Boolean);
  706. var
  707. BankItem: TReflectBankItem;
  708. begin
  709. if (not isBankOpen) then
  710. Exit;
  711. if BankItem.Find(item) then
  712. begin
  713. wait(randomrange(25, 150));
  714. BankItem.Withdraw(amount);
  715. result := true;
  716. end
  717. else
  718. begin
  719. writeln('Could not find: ' + item);
  720. logoutPlayer;
  721. terminatescript;
  722. result := false;
  723. end;
  724. end;
  725.  
  726. procedure WearGlory();
  727. var
  728. glory: TReflectInvItem;
  729. begin
  730. if nearOrbs then exit;
  731. gametab(tab_inv);
  732. sleep(random(20, 100));
  733. if not glory.Find('Amulet of glory(6)') and
  734. not glory.Find('Amulet of glory(5)') and
  735. not glory.Find('Amulet of glory(4)') and
  736. not glory.Find('Amulet of glory(3)') and
  737. not glory.Find('Amulet of glory(2)') and
  738. not glory.Find('Amulet of glory(1)') then
  739. Exit;
  740. begin
  741. Reflect.Mouse.Move(glory.GetPoint, 3, 3);
  742. sleep(random(20, 100));
  743. Reflect.Mouse.Click(mouse_left);
  744. end;
  745. end;
  746.  
  747. procedure WearStaff();
  748. var
  749. staff: TReflectInvItem;
  750. begin
  751. if nearOrbs then exit;
  752. gametab(tab_inv);
  753. sleep(random(20, 100));
  754. if not staff.Find('Staff of air') then
  755. Exit;
  756. begin
  757. Reflect.Mouse.Move(staff.GetPoint, 3, 3);
  758. sleep(random(20, 100));
  759. Reflect.Mouse.Click(mouse_left);
  760. end;
  761. end;
  762.  
  763. function getNewGlory: boolean;
  764. begin
  765. if (not isBankOpen) then
  766. exit;
  767. WithdrawItems('Amulet of glory(6)', 1, true);
  768. sleep(random(20, 100));
  769. closeinterface;
  770. sleep(random(60, 150));
  771. wearGlory();
  772. end;
  773.  
  774. procedure OpenBank();
  775. var
  776. Bank: TReflectObject;
  777. t: Timer;
  778. begin
  779. checkglory();
  780. if (Interfaces[PINSCREEN].isVisible()) then
  781. inPin(Pin);
  782. if (isBankOpen()) then
  783. exit;
  784. if bank.Find(objGame, 'Bank booth', 10) then
  785. begin
  786. Reflect.Mouse.Move(bank.GetMSPoint, 10, 10);
  787. if TReflectionText.IsUpText('Bank booth') then
  788. begin
  789. case randomRange(0, 6) of
  790. 0..5:
  791. begin
  792. Reflect.Mouse.Click(mouse_left);
  793. end;
  794. 6:
  795. begin
  796. Reflect.Mouse.Click(MOUSE_RIGHT);
  797. TReflectionText.ChooseOption('ank booth');
  798. end;
  799. end;
  800. end
  801. else
  802. begin
  803. Reflect.Mouse.Click(MOUSE_RIGHT);
  804. if TReflectionText.ChooseOption('ank booth') then waitfunc(@ isbankOpen, 50, 5000) else randomCompass();
  805. end;
  806. wait(800);
  807. end;
  808. t.start();
  809. while ((not isBankOpen()) and (not Interfaces[PINSCREEN].isVisible())) and (t.TimeElapsed() < 3000) do
  810. sleep(random(150, 250));
  811. end;
  812.  
  813. procedure bank();
  814. var
  815. BankItem: TReflectBankItem;
  816. begin
  817. if (not isBankOpen) then
  818. Exit;
  819. if (Interfaces[PINSCREEN].isVisible()) then
  820. InPin(MyPlayer.Pin);
  821. if getinvcount > 0 then
  822. quickDeposit('inventory');
  823. if (getHealthPercent <= 95) then
  824. begin
  825. WithdrawItems(foodtype, 5, true);
  826. closeInterface;
  827. repeat
  828. eatfood();
  829. wait(randomrange(1200, 1800));
  830. if (not myplayer.isloggedin) then
  831. exit
  832. until ((getHealthPercent >= 95) or (not TReflectionInventory.Contains([foodtype])));
  833. exit;
  834. end
  835. else if (depleted = true) then
  836. begin
  837. getNewGlory();
  838. end
  839. else
  840. begin
  841. if foodtoTake = 1 then
  842. WithdrawItems(foodtype, foodtoTake, true)
  843. else if foodtoTake = 2 then
  844. begin
  845. WithdrawItems(foodtype, 1, true);
  846. WithdrawItems(foodtype, 1, true);
  847. end;
  848. begin
  849. WithdrawItems('Cosmic rune', 78, true);
  850. WithdrawItems('Unpowered orb', 78, true);
  851. end;
  852. sleep(random(150, 250));
  853. end;
  854. wait(1500);
  855. end;
  856.  
  857. procedure ToBank();
  858. begin
  859. if NearBank then
  860. exit;
  861. begin
  862. Wait(RandomRange(200, 600));
  863. myplayer.blindwalkMM(Point(3093 + random( - 2, 2), 3491 + random( - 2, 2)));
  864. waitfunc(@ NearBank, 10, 10000);;
  865. while (myPlayer.ismoving) do
  866. Randomwait;
  867. end;
  868. end;
  869.  
  870. procedure EdgeTele();
  871. begin
  872. if not Myplayer.isloggedin() then
  873. exit;
  874. WearGlory();
  875. WearStaff();
  876. gameTab(TAB_EQUIP);
  877. sleep(20 + random(30));
  878. customMouse(point(639 + random( - 8, 8), (265 + random( - 8, 8))));
  879. sleep(20 + random(30));
  880. fastClick(Mouse_Right);
  881. sleep(20 + random(30));
  882. if TReflectionText.ChooseOption('Edgeville') then
  883. waitfunc(@NearEdge, 50, 6000);
  884. Wait(200 + random(1000));
  885. if (getHealthPercent <= 95) then
  886. eatFood();
  887. end;
  888.  
  889. function CheckIfClickedSpell(): boolean;
  890. begin
  891. result := TReflectionText.IsUpText('Cast')
  892. end;
  893.  
  894. procedure OrbDo();
  895. var
  896. Obby: TReflectObject;
  897. begin
  898. if (checkifclickedspell = false) then
  899. begin
  900. gameTab(TAB_MAGIC);
  901. customMouse(point(569 + random( - 4, 4), (398 + random( - 4, 4))));
  902. wait(randomrange(10, 170));
  903. fastclick(mouse_left);
  904. end;
  905. begin
  906. if Obby.Find(objGame, 'Obelisk of Air', 9) then
  907. begin
  908. Reflect.Mouse.Move(Obby.GetMSPoint, 5, 5);
  909. //if TReflectionText.IsUpText('Obelisk') then
  910. fastclick(mouse_left);
  911. if not (didClick(true, 1000)) then
  912. exit;
  913. if (didClick(true, 1000)) then
  914. waitfunc(@ OrbTextVisible, 50, 4000);
  915. if (OrbTextVisible() = true) then
  916. begin
  917. Wait(RandomRange(100, 300));
  918. CustomMouse(OrbPosition);
  919. if TReflectionText.IsUpText('Make') then
  920. begin
  921. Wait(RandomRange(80, 100));
  922. fastClick(mouse_Right);
  923. if TReflectionText.ChooseOption('Make All') then
  924. begin
  925. Wait(RandomRange(80, 100));
  926. case random(0, 6) of
  927. 0..4: mouseOffScreen;
  928. 4..6: AntiClick;
  929. end
  930. Tim.start;
  931. repeat
  932. wait(randomrange(250, 800));
  933. if myplayer.IsUnderAttack then
  934. begin
  935. Edgetele();
  936. if nearEdge then ToBank() else exit;
  937. OpenBank();
  938. Bank(); //note to self *** prevents from walking to obby with uncharged glory, if used last charge of glory when teleing from player, and still have unp orbs + cosmics
  939. switchRandomWorld();
  940. exit;
  941. end;
  942. CurrentXp := myPlayer.GetSkillExp(SKILL_MAGIC);
  943. Proggy();
  944. if ((ClickToContinue) and (GotUnpOrbs()) and (GotCosmics())) then
  945. orbDo();
  946. until ((not GotCosmics) {or (not MakingOrbs())} or (not gotUnpOrbs) or (not myplayer.isloggedin) or (tim.timeElapsed > 150000));
  947. end
  948. else
  949. exit;
  950. end
  951. else
  952. exit;
  953. end
  954. else
  955. exit;
  956. end
  957. else
  958. exit;
  959. end;
  960. wait(randomrange(2000, 6000));
  961. end;
  962.  
  963. procedure loop();
  964. begin
  965. proggy();
  966. if (not myplayer.isLoggedIn()) then
  967. Login();
  968. if ((not GotCosmics()) and (not NearEdge()) and (not NearBank())) or ((not GotUnpOrbs()) and (not NearBank())) then
  969. EdgeTele();
  970. if ((not GotCosmics()) and (NearEdge()) and (not NearBank() and (not nearSewer()) and (not NearOrbs()) and (not NearTrapdoor()))) or ((not GotUnpOrbs()) and (NearEdge()) and (not NearBank() and (not nearSewer()) and (not NearOrbs()) and (not NearTrapdoor()))) then
  971. ToBank();
  972. if ((nearBank()) and (not GotCosmics()) and (not isBankOpen())) or ((nearBank()) and (not GotUnpOrbs()) and (not isBankOpen())) or ((nearBank()) and (GotAirOrbs()) and (not isBankOpen())) then
  973. OpenBank();
  974. if (isBankOpen()) then
  975. bank();
  976. if ((NearLadder()) and (GotUnpOrbs()) and (GotCosmics())) then
  977. upLadder();
  978. if ((NearOrbs()) and (GotUnpOrbs()) and (GotCosmics())) then
  979. OrbDo();
  980. if ((GotUnpOrbs()) and (GotCosmics()) and (not nearSewer()) and (not NearOrbs()) and (not NearTrapdoor())) then
  981. ToTrapDoor();
  982. if ((GotUnpOrbs()) and (GotCosmics()) and (NearSewer())) then
  983. ToLadder();
  984. if ((GotUnpOrbs()) and (GotCosmics()) and (NearTrapdoor())) then
  985. openDoor();
  986. Antiban();
  987. end;
  988.  
  989. begin
  990. InitAL();
  991. Reflect.Setup();
  992. MyPlayer.Create();
  993. SetUp();
  994. reflect.mouseSpeed := Random(30, 40);
  995. repeat
  996. loop();
  997. until (false);
  998. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement