Advertisement
Guest User

Untitled

a guest
Mar 18th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.13 KB | None | 0 0
  1. program NightmarezoneV8;
  2. {$DEFINE WALKER}
  3. {$DEFINE SMART}
  4. {$i AeroLib/AeroLib.Simba}
  5.  
  6. var
  7. XpPerHour, cXpPerHour, hpXpPerHour, StartTotalExp, Games: integer;
  8. AbsorbPotsBarrel, OverloadPotsBarrel, BenefitBox, Item_RockCake, Item_AbsorbPotion, Item_OverloadPotion: TItem;
  9. RewardChest, OverloadBarrel, AbsorbBarrel, Button, DrinkPotion, DominicOnion: TMSObject;
  10. ssTimer, MinigameStuckTimer, PrayerF, ProgressReportT: Timer;
  11. XPStart, MinigameSWalk, GameOne: boolean;
  12.  
  13. const
  14. VERSION := '9';
  15. OVERLOADPOTIONS := 11;
  16. USERNAME := '';
  17. PASSWORD := '';
  18. ATTACKSTYLE := 'Strength';
  19. SCREENSHOTTIMER := 600000;
  20. DEBUG:= FALSE;
  21. USEDHAROKS:= FALSE;
  22. USEBREAKS:= true;
  23.  
  24. procedure declarePlayer();
  25. begin
  26. Me.Name := USERNAME;
  27. Me.Pass := PASSWORD;
  28. Me.Member := True;
  29. Me.Active := True;
  30. end;
  31.  
  32. procedure GlobalFree;
  33. begin
  34. freeDTM(Item_RockCake.DTM);
  35. freeDTM(Item_AbsorbPotion.DTM);
  36. freeDTM(Item_Overloadpotion.DTM);
  37. FreeDTM(AbsorbPotsBarrel.DTM);
  38. FreeDTM(OverloadPotsBarrel.DTM);
  39. FreeDTM(BenefitBox.DTM);
  40. end;
  41.  
  42. procedure InitializeScript;
  43. begin
  44. AbsorbPotsBarrel.DTM := DTMFromString('mrAAAAHic42BgYPgPxAZQfJWRgeE6EHMB8VUgPxRITwbiHiCeCMSdUBrEnw7E04CYUsBIAMMAAMS0CN8=');
  45. OverloadPotsBarrel.DTM := DTMFromString('mlwAAAHicY2dgYPgCxCZQfJ6RgeECEDMD8WcgfyKQ7gHiCUDcCcRToPxpQEwuYMSDoQAAwIUH9g==');
  46. Benefitbox.DTM := DTMFromString('m6wAAAHic42ZgYDjFyMCwAoiXA/E7KD4NxGeAeCcQLwbiXUB8D4hTgDgWiLOBOAfKjoSyc6DyCUCcDMT/Z8gz+Ph6gnFcfBSYdvdwZfD0dGOIjAxhKEoJBKsBYVIAIwkYCQAA77EZsg==');
  47. Item_OverloadPotion.Name := 'Overload';
  48. Item_OverloadPotion.DTM := DTMFromString('m6wAAAHic42ZgYOAEYl4g5gNiASAWhrJZGSCACYjZgJgdiMWhfB6oWgkgloZiUSAWBGJuqD4RQRCPkSgsyUA8IM5ECEYCAAd/AY0=');
  49. Item_RockCake.Name := 'Dwarven rock cake';
  50. Item_RockCake.DTM := DTMFromString('mqAEAAHicE2FgYOAFYmEgFgViCSgWg4oJADEPEHMCMRsQMzNAABMQM0L5bFB5Xqh6LiziolAzxaHmg2gRIBYCYj4g5kYynwVqPhPUrvxUb6ht1MEiDNQF1HMZBGMDAO4EA0c=');
  51. Item_AbsorbPotion.Name := 'Absorbtion Potion';
  52. Item_AbsorbPotion.DTM := DTMFromString('mKgEAAHicnc07CoBADIThUXyuuIgriI/738DWxov5y6bQch34isAk8ZIaONQoUSFXTAaPgBGDzT22V+e50VlnxoodCybba1HgOC/bSuP0L+mfom9u6uoDxw==');
  53. DominicOnion.create('DominicOnion', ['omini', 'nion', 'inic', 'Domi'], [createCol(3831170, 8, 0.05, 1.34)], [createCol(3577466, 2, 0.09, 0.23)]);
  54. DrinkPotion.create('DrinkPotion', ['rink', 'Dri', 'pot', 'ion'], [CreateCol(2961232, 6, 0.16, 0.15)], [createCol(4680063, 8, 0.12, 0.13)]);
  55. Button.create('AcceptButton', ['con', 'tin', 'ue'], [createcol(65280, 0)]);
  56. AbsorbBarrel.create('AbsorbBarrel', ['bsor', 'pti'], [createCol(4421779, 10, 0.03, 0.11)], [createCol(5789791, 15, 0.19, 0.05)]);
  57. OverloadBarrel.create('OverloadBarrel', ['verloa', 'Over'], [createCol(4421779, 10, 0.03, 0.11)], [createCol(5789791, 15, 0.19, 0.05)]);
  58. RewardChest.create('RewardChest', ['earch', 'ewards', 'hest', 'ewa'], [createCol(3228506, 20, 0.05, 0.08)], [createCol(1347520, 11, 0.01, 0.34)]);
  59. end;
  60.  
  61. function GoogleDriveStatus: string;
  62. var
  63. fileName, Bot_SavePath: string;
  64. GooglePath: string;
  65. i,FileHandle: integer;
  66. begin
  67. GooglePath := 'C:/Users/Gebruiker/Google Drive/NMZ';
  68. if (not directoryExists(GooglePath)) then
  69. exit;
  70. try
  71. Filehandle:= OpenFile(GooglePath + '/Running.txt',true);
  72. ReadFileString(FileHandle,result,5);
  73. except
  74. writeln('Error');
  75. exit;
  76. end;
  77. closeFile(FileHandle);
  78. end;
  79.  
  80.  
  81.  
  82. procedure TakeScreenCustom();
  83. var
  84. i: integer;
  85. begin
  86. if not (FileExists('C:\Users\Gebruiker\Google Drive\NMZ' + inttostr(i) + '.png')) then
  87. begin
  88. TakeScreen(inttostr(i), 'C:\Users\Gebruiker\Google Drive\NMZ\');
  89. writeln('C:\Users\Gebruiker\Google Drive\NMZ\' + (inttostr(i)) + '.png');
  90. inc(i);
  91. exit;
  92. end;
  93. end;
  94.  
  95. procedure ScreenShotProgress;
  96. begin
  97. if(ssTimer.TimeElapsed > SCREENSHOTTIMER) then
  98. begin
  99. TakeScreenCustom;
  100. ssTimer.start;
  101. end;
  102. end;
  103.  
  104. procedure cProgressReport;
  105. begin
  106. if (ProgressReportT.timeElapsed > 20000) then
  107. begin
  108. XpPerHour := Round((getXpBarAmount - StartTotalExp) / (GetTimeRunning / 3600000.0));
  109. cXpPerHour := (Round((XpPerHour / 5.33) * 4));
  110. hpXpPerHour := (Round((XpPerHour / 5.33) * 1.33));
  111. cleardebug;
  112. writeln(' Eduards NightmareZone V'+(VERSION));
  113. writeln('- Total XP: ' + inttostr(getXpBarAmount - StartTotalExp));
  114. writeln('- Total XP/hr: ' + inttostr(XpPerHour));
  115. writeln('- ' + ATTACKSTYLE + ' XP/hr: ' + FloattoStr(cXpPerHour));
  116. writeln('- HP XP/hr: ' + FloattoStr(hpXpPerHour));
  117. writeln('- Time Running: ' + TimeRunning);
  118. ProgressReportT.start;
  119. end;
  120. end;
  121.  
  122. procedure customMouse(point: TPoint);
  123. begin
  124. case random(0, 6) of
  125. 0..2: BrakeMMouse(point, random(5), random(5), true);
  126. 3: BrakeMMouse(point, random(5), random(5), false);
  127. 4..5: MissMouse(point, random(5), random(5));
  128. 6: HumanMMouse(point, random(5), random(5));
  129. end;
  130. end;
  131.  
  132. function OpenReportFile(): integer;
  133. var
  134. fileName, Bot_SavePath: string;
  135. SavePathVersion: string;
  136. begin
  137. SavePathVersion := 'NMZV' + (VERSION) + '\';
  138. Bot_SavePath := ScriptPath + SavePathVersion;
  139. if (not directoryExists(Bot_SavePath)) then
  140. forceDirectories(Bot_SavePath);
  141. fileName := 'NMZAerolibV' + (VERSION) + '.txt';
  142. fileName := Bot_SavePath + fileName;
  143. try
  144. if (fileExists(fileName)) then
  145. result := appendFile(fileName)
  146. else
  147. result := createFile(fileName);
  148. except
  149. writeln('Error');
  150. end;
  151. end;
  152.  
  153. procedure AddReport(s: string);
  154. var
  155. tmpFile: integer;
  156. begin
  157. tmpFile := OpenReportFile();
  158. if (tmpFile >= 0) then
  159. try
  160. writeFileString(tmpFile, 'Time: '+TheTime+ ' '+s + #13 + #10);
  161. if(DEBUG) then writeln(s);
  162. except
  163. Writeln('Error writing File');
  164. finally
  165. closeFile(tmpFile);
  166. end;
  167. end;
  168.  
  169.  
  170. procedure CreateDirectoriesForScript;
  171. begin
  172. if (not directoryExists(ScriptPath + '/NMZV' + (VERSION) + '/')) then
  173. if (forceDirectories(ScriptPath + '/NMZV' + (VERSION) + '/')) then
  174. begin
  175. AddReport('[CDFC] Succesfully forced NMZ directory');
  176. end;
  177. if (not directoryExists(ScriptPath + '/NMZV' + (VERSION) + '/' + 'Errors/')) then
  178. if (forceDirectories(ScriptPath + '/NMZV' + (VERSION) + '/' + 'Errors/')) then
  179. begin
  180. AddReport('[CDFC] Succesfully forced NMZ/Errors/ directory');
  181. end;
  182. if (not directoryExists(ScriptPath + '/NMZV' + (VERSION) + '/' + 'Breaks/')) then
  183. if (forceDirectories(ScriptPath + '/NMZV' + (VERSION) + '/' + 'Breaks/')) then
  184. begin
  185. AddReport('[CDFC] Succesfully forced NMZ/Breaks/ directory');
  186. end;
  187. if (not directoryExists(ScriptPath + '/NMZV' + (VERSION) + '/' + 'Proggies/')) then
  188. if (forceDirectories(ScriptPath + '/NMZV' + (VERSION) + '/' + 'Proggies/')) then
  189. begin
  190. AddReport('[CDFC] Succesfully forced NMZ/Proggies/ directory');
  191. end;
  192. end;
  193.  
  194. procedure Updater;
  195. var
  196. NewFile: integer;
  197. OnlineVersion, NewScript, NewFileName: string;
  198. begin
  199. OnlineVersion := GetPage('http://pastebin.com/raw/hB5uBFUV');
  200. if (trim(OnlineVersion) > VERSION) then
  201. begin
  202. AddReport('Update Available! ');
  203. AddReport('Updating script to V' + OnlineVersion);
  204. NewScript := GetPage('http://pastebin.com/raw/X0t5Vg2e');
  205. NewFileName := scriptPath + 'NMZAerolib' + Trim(OnlineVersion) + '.simba';
  206. NewFile := Rewritefile(NewFileName, true);
  207. try
  208. WriteFileString(NewFile, NewScript);
  209. except
  210. begin
  211. AddReport('Fatal error writing to ' + NewFileName + '!!');
  212. terminatescript;
  213. end;
  214. end;
  215. CloseFile(NewFile);
  216. AddReport('New script downloaded to ' + NewFileName + '. Please restart Simba.');
  217. TerminateScript;
  218. end
  219. else
  220. AddReport('You have the latest version!');
  221. end;
  222.  
  223. procedure XpTracker;
  224. begin
  225. if not (XPStart) then
  226. begin
  227. XPStart := True;
  228. toggleXPBar(True, True);
  229. StartTotalExp := GetXpBarAmount;
  230. AddReport('Starting XP is: ' + inttostr(StartTotalExp) + '.');
  231. end;
  232. end;
  233.  
  234.  
  235. function MinigameCheck: boolean;
  236. begin
  237. if isLoggedIn then
  238. begin
  239. if (PercentBlackMM < 5) then
  240. begin
  241. AddReport('*MGC -> False');
  242. exit(false);
  243. end
  244. else
  245. exit(true);
  246. end
  247. else
  248. exit(false);
  249. end;
  250.  
  251. function BreakingCheck: boolean;
  252. var
  253. CurrentHour, CurrentMinute: integer;
  254. begin
  255. getLocalTime(CurrentHour,CurrentMinute);
  256. if(CurrentHour > 7) and (CurrentHour < 24) then
  257. begin
  258. AddReport('*BC -> False -> H->'+inttostr(CurrentHour));
  259. exit(false)
  260. end else
  261. begin
  262. AddReport('*BC -> True -> H->'+inttostr(CurrentHour));
  263. exit(true)
  264. end;
  265. end;
  266.  
  267. procedure AntiBan;
  268. var
  269. ItemBox: Tbox;
  270. equipPiece: string;
  271. begin
  272. if (not (isLoggedIn)) then
  273. exit;
  274. case random(15000) of
  275. 6:
  276. begin
  277. AddReport('Antiban 6');
  278. hoverSkill('random', false);
  279. MMouseOffClient('rand');
  280. end;
  281. 1005:
  282. if GameTab(TAB_EQUIP) then
  283. if wearingItem(6) then
  284. begin
  285. case random(4) of
  286. 0: equipPiece := 'chest';
  287. 1: equipPiece := 'amulet';
  288. 2: equipPiece := 'weapon';
  289. 3: equipPiece := 'legs';
  290. 4: equipPiece := 'boots';
  291. 5: equipPiece := 'helm';
  292. end;
  293. ItemBox := GetEquippedItemBounds(equipPiece);
  294. GaussMouseBox(ItemBox.X1, ItemBox.Y1, ItemBox.X2, ItemBox.Y2, MOUSE_RIGHT);
  295. if not ChooseOption('Check') then
  296. ChooseOption('Examine')
  297. else
  298. ChooseOption('Check');
  299. wait(randomrange(900, 2200));
  300. MMouseOffClient('Rand');
  301. end;
  302. 111:
  303. begin
  304. AddReport('Antiban 111');
  305. examineInv();
  306. end;
  307. 115:
  308. begin
  309. AddReport('Antiban 115');
  310. MMouseOffClient('top');
  311. end;
  312. 160:
  313. begin
  314. AddReport('Antiban 160');
  315. SleepAndMoveMouse(randomrange(1000, 1200));
  316. end;
  317. 170:
  318. begin
  319. AddReport('Antiban 170');
  320. humanRandomMouse;
  321. end;
  322. 180:
  323. begin
  324. AddReport('Antiban 180');
  325. randomMovement;
  326. end;
  327. 190:
  328. begin
  329. AddReport('Antiban 190');
  330. boredHuman;
  331. end;
  332. 200:
  333. begin
  334. AddReport('Antiban 200');
  335. examineInv;
  336. end;
  337. 210:
  338. begin
  339. AddReport('Antiban 210');
  340. randomFKeys(true);
  341. end;
  342. end;
  343. end;
  344.  
  345. function OutsideCheck: boolean;
  346. begin
  347. if isLoggedIn then
  348. begin
  349. if not (Me.inCombat) then
  350. begin
  351. if (PercentBlackMM < 5) then
  352. begin
  353. if (GetHealthPercent > 90) then
  354. begin
  355. AddReport('*Outside -> True');
  356. result := true;
  357. end
  358. else
  359. result := false;
  360. end;
  361. end;
  362. end
  363. else
  364. result := false;
  365. end;
  366.  
  367. function FSM: integer;
  368. begin
  369. if(USEBREAKS) then
  370. if (BreakingCheck) then
  371. exit(1);
  372. if not isLoggedIn then
  373. LoginPlayer(false);
  374. if (OutsideCheck) then
  375. exit(3);
  376. if (MinigameCheck) then
  377. exit(2);
  378. end;
  379.  
  380. procedure Overloading;
  381. begin
  382. if(FSM = 2) then
  383. if (GetCurrentHealth <> 1) then
  384. begin
  385. if (GetCurrentHealth >= 51) then
  386. begin
  387. AddReport('Overloading');
  388. case random(9) of
  389. 0..1: Wait(randomrange(1000, 2000));
  390. 2..9:
  391. begin
  392. if (not (Item_Overloadpotion.InInventory)) then
  393. begin
  394. AddReport('Overloading -> Guzzling');
  395. repeat
  396. if (GetCurrentHealth >= 51) then
  397. begin
  398. Item_RockCake.interact(Mouse_Right);
  399. if (WaitOption('Guzzle', 200)) then
  400. begin
  401. wait(randomrange(1000, 2000));
  402. PrayerF.start;
  403. end;
  404. end;
  405. until (getCurrentHealth = 1);
  406. end;
  407. end;
  408. end;
  409. case random(100) of
  410. 0..99:
  411. begin
  412. Item_Overloadpotion.interact(mouse_left);
  413. wait(randomrange(500, 1000));
  414. end;
  415. 100:
  416. begin
  417. Item_Overloadpotion.interact('drink');
  418. end;
  419. end;
  420. case random(1) of
  421. 0: MMouseOffClient('bottom');
  422. 1: MMouseOffClient('right');
  423. end;
  424. Wait(randomrange(4900, 5200));
  425. end;
  426. end;
  427. end;
  428.  
  429. procedure RockCake;
  430. var
  431. iBox: TBox;
  432. begin
  433. if(FSM = 2) then
  434. repeat
  435. if(FSM = 2) then
  436. begin
  437. if (GetCurrentHealth < 52) then
  438. exit;
  439. GameTab(TAB_INV);
  440. Item_RockCake.interact(Mouse_left);
  441. wait(randomrange(200, 300));
  442. if (GetCurrentHealth < 55) then
  443. begin
  444. Wait(randomrange(800, 1000));
  445. end;
  446. end;
  447. AddReport('Rockcake');
  448. until (getCurrentHealth = 51);
  449. if toggleQP(true) then
  450. wait(randomrange(150, 250));
  451. if toggleQP(false) then
  452. wait(randomrange(150, 300));
  453. end;
  454.  
  455. function AbsorbStatus(): boolean;
  456. var
  457. absCol : TColEx;
  458. begin
  459. absCol.create(16777215, 0, 0.00, 0.00); // if your hue/sat mod is "0.2" then don't add the last 2 parameters
  460. result := absCol.findIn(toBox(9,22,76,75));
  461. end;
  462.  
  463.  
  464. procedure Absorbing;
  465. var
  466. z, i: integer;
  467. begin
  468. if(FSM = 2) then
  469. if not (AbsorbStatus) then
  470. begin
  471. AddReport('Absorbing');
  472. GameTab(TAB_INV);
  473. if (Item_AbsorbPotion.inInventory) then
  474. begin
  475. case random(100) of
  476. 0..1: exit;
  477. 2..10: Wait(randomrange(1000, 2000));
  478. 11..19:
  479. begin
  480. for i := 0 to 3 do
  481. begin
  482. AddReport(' x7');
  483. Item_absorbpotion.interact(mouse_left);
  484. Wait(randomrange(1000, 1450));
  485. end;
  486. end;
  487. 20..21:
  488. begin
  489. AddReport(' -> drink');
  490. item_absorbpotion.interact('Drink');
  491. end;
  492. 22..100:
  493. begin
  494. for i := 0 to 4 do
  495. begin
  496. AddReport(' -> left click');
  497. Item_absorbpotion.interact(mouse_left);
  498. Wait(randomrange(1000, 1250));
  499. end;
  500. end;
  501. end;
  502. case random(1) of
  503. 0: MMouseOffClient('bottom');
  504. 1: MMouseOffClient('right');
  505. end;
  506. wait(randomrange(100, 300));
  507. end
  508. else
  509. begin
  510. wait(randomrange(1000, 1500));
  511. end;
  512. end;
  513. end;
  514.  
  515. function InventoryCheck: boolean;
  516. var
  517. OverloadPotionSlots, AbsorbPotionSlots: array of integer;
  518. begin
  519. if isLoggedIn then
  520. begin
  521. AddReport('Inventory Check');
  522. if (GameTab(TAB_INV)) then
  523. begin
  524. OverloadPotionSlots := Item_OverloadPotion.getSlots;
  525. AbsorbPotionSlots := Item_AbsorbPotion.getSlots;
  526. AddReport(' Overloads -> '+inttostr(high(OverloadPotionSlots) + 1));
  527. AddReport(' Overloads -> '+inttostr(high(AbsorbPotionSlots) + 1));
  528. if ((high(OverloadPotionSlots) + 1) < OVERLOADPOTIONS) or (((High(AbsorbPotionSlots) + 1) + OVERLOADPOTIONS) < 27) then
  529. begin
  530. result := false;
  531. end
  532. else
  533. result := true;
  534. end;
  535. end
  536. else
  537. result := false;
  538. end;
  539.  
  540.  
  541.  
  542. procedure RandomBreaker;
  543. var
  544. Hours,Minutes: integer;
  545. randomminutebreak: integer;
  546. begin
  547. if(GameOne) then
  548. exit;
  549. GetLocalTime(Hours,Minutes);
  550. case random(7) of
  551. 0..7:
  552. AddReport('RB -> Not breaking');
  553. 8:
  554. begin
  555. AddReport('RB -> Breaking');
  556. LogoutPlayer;
  557. if(Minutes < 30) then
  558. begin
  559. randomminutebreak:= randomrange(10,29);
  560. AddReport('RB -> we are randomly breaking' +inttostr(randomminutebreak)+' minutes.');
  561. WaitUntilTime(Hours,randomminutebreak);
  562. end;
  563. if(Minutes >= 30) then
  564. begin
  565. randomminutebreak:= randomrange(1,10);
  566. AddReport('RB -> we are randomly breaking 1 hour and ' +inttostr(randomminutebreak)+' minutes.');
  567. WaitUntilTime(Hours + 1,randomminutebreak);
  568. end;
  569. LoginPlayer(false);
  570. end;
  571. end;
  572. end;
  573.  
  574. procedure BreakingExecute;
  575. var
  576. BreakingTimer: Timer;
  577. begin
  578. if(BreakingCheck) then
  579. begin
  580. AddReport('*BE -> True');
  581. logoutplayer;
  582. //SetupBreak(5,480,20,60);
  583. end;
  584. end;
  585.  
  586.  
  587. function TalkToDominicUnion: boolean;
  588. var
  589. DominicOnionTPA: TPoint;
  590. ErrorTimer: Timer;
  591. begin
  592. ErrorTimer.start;
  593. while (ErrorTimer.timeElapsed < 60000) do
  594. begin
  595. if (DominicOnion.find(10, MSCP, DominicOnionTPA)) then
  596. begin
  597. fastclick(mouse_right);
  598. if (WaitOption('Dream', 1500)) then
  599. begin
  600. AddReport('TTDU -> True');
  601. exit(true);
  602. end;
  603. end
  604. else
  605. exit(false);
  606. end;
  607. exit(false);
  608. end;
  609.  
  610. function FinishConversation: boolean;
  611. var
  612. PreviousBox: TBox;
  613. Yes: Tbox;
  614. ErrorTimer: Timer;
  615. begin
  616. ErrorTimer.start;
  617. result := false;
  618. while (ErrorTimer.timeElapsed < 60000) do
  619. begin
  620. PreviousBox := inttoBox(137, 441, 384, 450);
  621. Yes := inttoBox(250, 396, 268, 405);
  622. while not (GetNPCChatName = ':hchdreamwouldyou:etoexperience?') do
  623. begin
  624. waitChatChange;
  625. if (ClickToContinue) then
  626. begin
  627. while not (GetNPCChatNAme = 'Discard:edreamyousetup?') do
  628. begin
  629. waitChatChange;
  630. exit(true);
  631. end;
  632. end;
  633. end;
  634. GaussMouseBox(PreviousBox.x1, PreviousBox.y1, PreviousBox.x2, PreviousBox.y2, 1);
  635. while not (GetNPCChatName = 'DominicOnion') do
  636. waitChatChange;
  637. while not (ClickToContinue) do
  638. waitChatChange;
  639. while not (GetNPCChatName = 'Agreetopay:S,MMMcoins?') do
  640. waitChatChange;
  641. GaussMouseBox(Yes.x1, Yes.y1, Yes.x2, Yes.y2, 1);
  642. waitChatChange;
  643. if (ClickToContinue) then
  644. begin
  645. AddReport('FC -> True');
  646. exit(true);
  647. end;
  648. end;
  649. exit(false);
  650. end;
  651.  
  652. function DrinkDreamPotion: boolean;
  653. var
  654. DrinkPotionTPA: TPoint;
  655. ErrorTimer: Timer;
  656. begin
  657. ErrorTimer.start;
  658. while (ErrorTimer.timeElapsed < 60000) do
  659. begin
  660. if (DrinkPotion.find(10, MSCP, DrinkPotionTPA)) then
  661. begin
  662. AddReport('DDP -> True');
  663. case random(10) of
  664. 0..8:
  665. begin
  666. wait(randomrange(500, 1000));
  667. fastclick(mouse_left);
  668. while (IsPlayerWalking) do
  669. wait(1000);
  670. exit(true);
  671. end;
  672. 9..10:
  673. begin
  674. fastclick(mouse_right);
  675. wait(randomrange(500, 1000));
  676. if (ChooseOption('rink')) then
  677. while (IsPlayerWalking) do
  678. wait(1000);
  679. exit(true);
  680. end;
  681. end;
  682. end;
  683. end
  684. else
  685. exit(false);
  686. end;
  687.  
  688. function StartDream: boolean;
  689. var
  690. ButtonTPA: TPoint;
  691. ErrorTimer: Timer;
  692. begin
  693. ErrorTimer.start;
  694. while (ErrorTimer.timeElapsed < 60000) do
  695. begin
  696. if (Button.find(10, MSCP, ButtonTPA)) then
  697. begin
  698. wait(randomrange(500, 1000));
  699. fastclick(mouse_left);
  700. AddReport('SD -> True');
  701. exit(true);
  702. wait(randomrange(2000, 3000));
  703. end;
  704. end
  705. else
  706. exit(false);
  707. end;
  708.  
  709. function BuyPotionsRewardChest: boolean;
  710. var
  711. x,y: integer;
  712. MSBox: TBox;
  713. RewardChestTPA, OverloadPotionTP, AbsorbPotionTP: TPoint;
  714. ErrorTimer: Timer;
  715. begin
  716. ErrorTimer.start;
  717. while (ErrorTimer.timeElapsed < 60000) do
  718. begin
  719. MSBox := inttobox(MSX1, MSY1, MSX2, MSY2);
  720. if (RewardChest.find(10, MSCP, RewardChestTPA)) then
  721. begin
  722. fastclick(mouse_right);
  723. wait(randomrange(500, 1000));
  724. if (waitOption('Search', 5000)) then
  725. begin
  726. if(waitFindDTM(BenefitBox.DTM, x,y,inttobox(205,57,295,83),200,8000)) then
  727. wait(randomrange(4000, 4500));
  728. CustomMouse(Point(x,y));
  729. wait(randomrange(200,300));
  730. fastclick(mouse_left);
  731. wait(randomrange(1500, 2000));
  732. if (Item_Overloadpotion.findIn(MSBox, OverloadPotionTP)) then
  733. begin
  734. CustomMouse(OverloadPotionTP);
  735. wait(randomrange(500, 1000));
  736. Fastclick(mouse_right);
  737. if (WaitOption('Buy-X', 1000)) then
  738. begin
  739. wait(randomrange(500, 1000));
  740. Typesend('255', true);
  741. end;
  742. if (Item_Absorbpotion.findIn(MSBox, AbsorbPotionTP)) then
  743. begin
  744. CustomMouse(AbsorbPotionTP);
  745. wait(randomrange(500, 1000));
  746. Fastclick(mouse_right);
  747. if (WaitOption('Buy-X', 1000)) then
  748. begin
  749. wait(randomrange(500, 1000));
  750. Typesend('255', true);
  751. wait(randomrange(200, 500));
  752. Custommouse(Point(487, 42));
  753. fastclick(mouse_left);
  754. AddReport('BPRC -> True');
  755. Games:= 0;
  756. exit(true);
  757. end;
  758. end;
  759. end;
  760. end;
  761. end
  762. else
  763. exit(false);
  764. end
  765. else
  766. exit(false);
  767. end;
  768.  
  769. function WithdrawPotions: boolean;
  770. var
  771. x,y: integer;
  772. AbsorbBarrelTPA: TPoint;
  773. OverloadBarrelTPA: TPoint;
  774. AbsorbReq, OverloadReq: integer;
  775. ErrorTimer: Timer;
  776. begin
  777. ErrorTimer.start;
  778. while (ErrorTimer.timeElapsed < 60000) do
  779. begin
  780. SetCompass('N');
  781. SetAngle(0);
  782. if not(Inventorycheck) then
  783. begin
  784. if (AbsorbBarrel.find(4, Point(17, 49), AbsorbBarrelTPA)) then
  785. begin
  786. AbsorbReq := 16 - (high(Item_Absorbpotion.getSlots) + 1);
  787. fastclick(mouse_right);
  788. wait(randomrange(750, 1000));
  789. if (waitOption('Take Absorption', 5000)) then
  790. begin
  791. if(WaitFindDTM(AbsorbPotsBarrel.DTM,x,y,inttobox(2,339,518,480),200,8000)) then
  792. if (AbsorbReq <> 0) then
  793. TypeSend(inttostr(AbsorbReq * 4), true);
  794. end;
  795. end;
  796. end;
  797. if not (IsInvFull) then
  798. begin
  799. if (OverloadBarrel.find(4, Point(222, 183), OverloadBarrelTPA)) then
  800. begin
  801. wait(randomrange(200,300));
  802. fastclick(mouse_right);
  803. if (waitOption('Take Overload', 5000)) then
  804. begin
  805. if(WaitFindDTM(OverloadPotsBarrel.DTM,x,y,inttobox(2,339,518,480),200,8000)) then
  806. wait(randomrange(2000, 3000));
  807. TypeSend('44', true);
  808. AddReport('WP(o) -> True');
  809. exit(true);
  810. end;
  811. end;
  812. end else
  813. exit(true);
  814. end
  815. else
  816. exit(false);
  817. end;
  818.  
  819.  
  820. function CheckDharok: boolean;
  821. var
  822. ItemBox: Tbox;
  823. equipPiece: string;
  824. begin
  825. if not(USEDHAROKS) then
  826. exit(true);
  827. if GameTab(TAB_EQUIP) then
  828. if wearingItem(6) then
  829. begin
  830. case random(4) of
  831. 0: equipPiece := 'chest';
  832. 1: equipPiece := 'weapon';
  833. 2: equipPiece := 'legs';
  834. 3: equipPiece := 'helm';
  835. end;
  836. ItemBox := GetEquippedItemBounds(equipPiece);
  837. CustomMouse(MiddleBox(ItemBox));
  838. wait(randomrange(900, 2200));
  839. if(IsUpTextMulti(['25'])) then
  840. begin
  841. AddReport(GetUpText);
  842. writeln('dharoks is 25%. repair first.');
  843. result:= false;
  844. TerminateScript;
  845. end else
  846. exit(true);
  847. end;
  848. GameTab(TAB_INV)
  849. end;
  850.  
  851.  
  852. procedure OutsideExecute;
  853. begin
  854. if (InventoryCheck) then
  855. begin
  856. if(CheckDharok) then
  857. begin
  858. RandomBreaker;
  859. if(Games >= 4) then
  860. BuyPotionsRewardChest;
  861. AddReport('OutsideExecuteLoop -> Inv Check!');
  862. if (TalkToDominicUnion) then
  863. begin
  864. AddReport('OutsideExecuteLoop -> Talk to Dominic Union!');
  865. if (FinishConversation) then
  866. begin
  867. AddReport('OutsideExecuteLoop -> Finish Conversation!');
  868. if (DrinkDreamPotion) then
  869. begin
  870. AddReport('OutsideExecuteLoop -> Drink Dream Potion!');
  871. if (StartDream) then
  872. begin
  873. GameOne:= false;
  874. inc(Games)
  875. end;
  876. end;
  877. end;
  878. end;
  879. end;
  880. end
  881. else
  882. begin
  883. if (WithdrawPotions) then
  884. begin
  885. OutsideExecute;
  886. end
  887. else
  888. BuyPotionsRewardChest;
  889. end;
  890. end;
  891.  
  892. procedure CheckPlayerStuck;
  893. var
  894. MiniMapYellow: TPointArray;
  895. Path: TPointArray;
  896. HPBars: TPointArray;
  897. begin
  898. if(FSM = 2) then
  899. if (Me.incombat) then
  900. begin
  901. MinigameStuckTimer.start;
  902. exit;
  903. end
  904. else
  905. begin
  906. if (MinigameStuckTimer.TimeElapsed > randomrange(35000, 45000)) then
  907. begin
  908. AddReport('CPS -> True');
  909. MiniMapYellow := getMiniMapDots('yellow');
  910. Mouse(MiddleTPA(MiniMapYellow), 5, 5, 1);
  911. MinigameStuckTimer.start;
  912. case random(1) of
  913. 0: MMouseOffClient('top');
  914. 1: MMouseOffClient('right');
  915. end;
  916. end;
  917. end;
  918. end;
  919.  
  920. procedure Prayerflick;
  921. begin
  922. if(FSM = 2) then
  923. if (PrayerF.timeElapsed >= randomrange(45000, 55000)) then
  924. begin
  925. AddReport('PF -> True');
  926. case random(20) of
  927. 0..19:
  928. begin
  929. if toggleQP(true) then
  930. wait(randomrange(150, 250));
  931. if toggleQP(false) then
  932. wait(randomrange(150, 300));
  933. PrayerF.start;
  934. end;
  935. 20: PrayerF.start;
  936. end;
  937. case random(1) of
  938. 0: MMouseOffClient('top');
  939. 1: MMouseOffClient('right');
  940. end;
  941. end;
  942. end;
  943.  
  944. procedure HpDoubleCheck;
  945. begin
  946. if(FSM = 2) then
  947. if (GetCurrentHealth = 2) then
  948. begin
  949. Item_RockCake.interact(mouse_right);
  950. if (WaitOption('Guzzle', 1000)) then
  951. begin
  952. AddReport('HPDC -> True');
  953. wait(randomrange(1000, 2000));
  954. if toggleQP(true) then
  955. wait(randomrange(150, 250));
  956. if toggleQP(false) then
  957. wait(randomrange(150, 300));
  958. MMouseOffClient('Rand');
  959. PrayerF.start;
  960. end;
  961. end;
  962. end;
  963.  
  964. procedure MinigameExecute;
  965. begin
  966. PrayerFlick;
  967. RockCake;
  968. Absorbing;
  969. PrayerFlick;
  970. Overloading;
  971. HpDoubleCheck;
  972. AntiBan;
  973. cProgressReport;
  974. ScreenShotProgress;
  975. end;
  976.  
  977. procedure mainloop;
  978. begin
  979. // if(GoogleDriveStatus <> 'false') then
  980. // begin
  981. case FSM of
  982. // 1:BreakingExecute;
  983. 2:MinigameExecute;
  984. 3:OutsideExecute;
  985. end;
  986. // end else
  987. // begin
  988. // while(isLoggedIn) do
  989. // Logoutplayer;
  990. // AddReport('Script has been manually stopped by GoogleDrive text!');
  991. // end;
  992. end;
  993.  
  994. begin
  995. Updater;
  996. InitAL;
  997. declarePlayer;
  998. AddOnterminate('GlobalFree');
  999. SetSupressExceptions(True);
  1000. InitializeScript;
  1001. LoginPlayer(false);
  1002. MinigameStuckTimer.start;
  1003. ProgressReportT.start;
  1004. XpTracker;
  1005. MinigameSWalk := false;
  1006. GameOne:= false;
  1007. Games:= 4;
  1008. ssTimer.start;
  1009. repeat
  1010. //
  1011.  
  1012.  
  1013.  
  1014. breakhandler;
  1015. mainloop;
  1016. wait(randomrange(300, 400));
  1017. until (false)
  1018. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement