zamaro

NMZ script Rev 1

May 27th, 2014
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 43.10 KB | None | 0 0
  1. program NMZ;
  2. {$DEFINE SMART8}
  3. {$I SRL-OSR/SRL.Simba}
  4. {$I SRL-OSR/SRL/Reflection/Reflection.simba}
  5. {$i SRL-OSR\SRL\misc\debug.simba}
  6. {$i SRL-OSR\SRL\misc\SmartGraphics.simba}
  7. {$I F_AntiRandoms.simba}
  8.  
  9. var
  10. SpecTimer, Timer, Sleeptimer, Str1, Att1, Def1, Hp1: integer;
  11. PointInsideCave: tpoint;
  12. CaveBottomRight, CavetopRight, Cavebottomleft, Cavetopleft: tpoint;
  13. TimeTillSpec, TimeTillLongBreak, TimeTillBreak: string;
  14. DrinkTime: integer;
  15. DoneChest, DoneOverloads, DoneAbsobs: boolean;
  16. V: TVariantArray;
  17. MeInCave, myposinsidecave: tpoint;
  18.  
  19. const
  20. bankpin = ''; // your bank pin.
  21. TermCheck = true; // Terminate if lost?.
  22. Overloads = '40'; // How many overloads to Draw?.
  23. Absorbs = '72'; // How many Absorb potions to withdraw? put 0 if no absorbs.
  24. Hopworlds = true;
  25.  
  26. Breakhandler = true; // Enable breaking.
  27. BreakTime1 = 45; // Min time to play before breaking.
  28. BreakTime2 = 120; // max time to play before breaking.
  29. BreakWait1 = 5; // min time to break for,
  30. BreakWait2 = 15; // max time to break for. (random range).
  31.  
  32. SleepBreaks = true; // Sleep breaks, initiates after long hours of gameplay.
  33. SleepBreak1 = 8; // Min timeto play before starting a sleep break.
  34. SleepBreak2 = 12; // Max time to play before starting a sleep breka.
  35. SleepWait1 = 2; // Min time to sleep for ** TIME IN HOURS NOT MINUTES*
  36. SleepWait2 = 4; // Max time to sleep for (random range).
  37.  
  38. DoSpecs = true;
  39. ReSpecTime1 = 75000; // Takes the Spec Bar 5 minutes to recharge to full
  40. ReSpectime2 = 300000; // add in extra seconds of your own for randomness!
  41.  
  42. //3105, 2612
  43.  
  44. BarreloX = 2600;
  45. BarrelOY = 3116;
  46.  
  47. // 3111, 2611)
  48. CofferX = 2607;
  49. CofferY = 3114;
  50.  
  51. //3113, 2614
  52. ChestX = 2609;
  53. ChestY = 3119;
  54.  
  55.  
  56. BarrelaX = 2600;
  57. BarrelaY = 3117;
  58.  
  59. //3109, 2612
  60. VialX = 2605;
  61. VialY = 3117;
  62.  
  63. procedure playerSetup;
  64. var
  65. x, y: integer;
  66. begin
  67. HowManyPlayers := 1;
  68. NumberOfPlayers(HowManyPlayers);
  69. CurrentPlayer := 0;
  70. Players[0].Name := '@.com';
  71. Players[0].Pass := '';
  72. Players[0].Nick := '';
  73. Players[0].Active := True;
  74. end;
  75.  
  76. procedure WaitHumanClick;
  77. begin
  78. case random(600) of
  79. 1..450: Wait(RandomRange(600, 800));
  80. 451..570: Wait(RandomRange(800, 900));
  81. 571..590: Wait(RandomRange(900, 1000));
  82. 591..600: Wait(RandomRange(1000, 1200));
  83. end;
  84. end;
  85.  
  86. function OutsideCave: boolean;
  87. begin
  88. result := R_inPolygon([point(2635, 3130), point(2635, 3100), point(2598, 3100), point(2598, 3130)]);
  89. end;
  90.  
  91. function isinfight: boolean;
  92. begin
  93. result := (SRL_InFight)
  94. end;
  95.  
  96. function InsideCave: boolean;
  97. var
  98. TPA: TpointArray;
  99. tmpcts: integer;
  100. begin
  101. if (not (loggedin)) then
  102. exit;
  103. if OutsideCave then
  104. exit;
  105. tmpcts := GetColorToleranceSpeed;
  106. ColorToleranceSpeed(2);
  107. SetColorSpeed2Modifiers(0.12, 1.41);
  108. result := FindColorsTolerance(TPA, 1743843, MMX1, MMY1, MMX2, MMY2, 1);
  109. ColorToleranceSpeed(tmpcts);
  110. SetColorSpeed2Modifiers(0.2, 0.2);
  111. end;
  112.  
  113. procedure FindALlrandoms;
  114. begin
  115. R_FindNormalRandoms;
  116. FindNonInventoryRandoms;
  117. FindNormalRandoms;
  118. FindMod;
  119. end;
  120.  
  121. function PIdle: Boolean;
  122. begin
  123. FindALlrandoms;
  124. result := (not loggedin) or (LobbyScreen) or (R_InFight) or (R_UnderAttack)
  125. end;
  126.  
  127. procedure WaitAfterOverLoadClick;
  128. var
  129. WaiTMe, T: Integer;
  130. begin
  131. WaitMe := randomrange(4000, 35000);
  132. writeln(waitme);
  133. marktime(t);
  134. repeat
  135. wait(400);
  136. if not insidecave then
  137. exit;
  138. if OutsideCave then
  139. exit;
  140. if not IsInFight then
  141. exit;
  142. if not R_UnderAttack then
  143. exit;
  144. if (TimeFromMark(t) >= (WaitMe)) then
  145. exit;
  146. until (TimeFromMark(t) >= (WaitMe));
  147. end;
  148.  
  149. function GetGreenUptext: string;
  150. var
  151. WhiteT, BlueT, YellowT, OrangeT, GreenT, FoundText: string;
  152. begin
  153. WhiteT := GetTextAtExWrap(8, 8, 300, 21, 0, 5, 1, 14541281, 55, 'UpChars07');
  154. BlueT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 13423640, 65, 'UpChars07');
  155. YellowT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 1235160, 40, 'UpChars07');
  156. OrangeT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 4687583, 53, 'UpChars07');
  157. GreenT := GetTextAtExWrap(8, 8, 300, 21, 0, 5, 1, 120577, 65, 'UpChars07');
  158. FoundText := WhiteT + ' ' + BlueT + YellowT + OrangeT + GreenT;
  159. FoundText := ReplaceWrap(FoundText, '.', '', [rfReplaceAll]);
  160. FoundText := ReplaceWrap(FoundText, '/', '', [rfReplaceAll]);
  161. FoundText := ReplaceWrap(FoundText, '\', '', [rfReplaceAll]);
  162. FoundText := ReplaceWrap(FoundText, ',', '', [rfReplaceAll]);
  163. FoundText := ReplaceWrap(FoundText, '*', '', [rfReplaceAll]);
  164. FoundText := ReplaceWrap(FoundText, '^', '', [rfReplaceAll]);
  165. FoundText := ReplaceWrap(FoundText, '"', '', [rfReplaceAll]);
  166. Result := FoundText;
  167. end;
  168.  
  169. function IsUpTextMultiCustom2(Text: TStringArray): Boolean;
  170. var
  171. TheText: string;
  172. i, n: Integer;
  173. begin
  174. TheText := GetGreenUptext;
  175. n := High(Text);
  176. for i := 0 to n do
  177. if (Pos(Text[i], TheText) > 0) then
  178. begin
  179. Result := True;
  180. Exit;
  181. end;
  182. end;
  183.  
  184. function WaitUpTextMulti2(S: TStringArray; Time: Integer): Boolean;
  185. var
  186. T: Integer;
  187. begin
  188. Result := false;
  189. T := GetSystemTime + Time;
  190. while (GetSystemTime < T) do
  191. begin
  192. if (IsUpTextMultiCustom2(S)) then
  193. begin
  194. Result := True;
  195. Exit;
  196. end;
  197. Wait(20 + Random(20));
  198. end;
  199. end;
  200.  
  201. function OpenWScreen: Boolean;
  202. begin
  203. Result := False;
  204. if WorldScreen then
  205. exit;
  206. if Loggedin then
  207. Exit;
  208. if not WorldScreen then
  209. begin
  210. Mmouse(54, 475, 1, 1);
  211. WaitHumanClick;
  212. ClickMouse2(Mouse_Left);
  213. waithumanclick;
  214. Result := True;
  215. end;
  216. end;
  217.  
  218. function whitecolor: boolean;
  219. var
  220. Monster: TpointArray;
  221. TmpCts: Integer;
  222. begin
  223. tmpcts := GetColorToleranceSpeed;
  224. ColorToleranceSpeed(2);
  225. SetColorSpeed2Modifiers(0.22, 1.69);
  226. result := FindColorsTolerance(Monster, 9163999, 192, 67, 583, 469, 4);
  227. ColorToleranceSpeed(tmpcts);
  228. SetColorSpeed2Modifiers(0.2, 0.2);
  229. end;
  230.  
  231. procedure GraboriginalExp;
  232. begin
  233. writeln('we started the script loggedin.. Grabbing original exp for progress report!');
  234. Att1 := R_GetSkillExp(SKILL_ATTACK);
  235. Def1 := R_GetSkillExp(SKILL_DEFENCE);
  236. Str1 := R_GetSkillExp(SKILL_STRENGTH);
  237. Hp1 := R_GetSkillExp(SKILL_HITPOINTS);
  238. end;
  239.  
  240. procedure donormallogin;
  241. begin
  242. if (LobbyScreen) then
  243. begin
  244. WRITELN('we are on lobbyscreen!');
  245. MouseBox(280, 300, 480, 375, mouse_Left);
  246. wait(randomrange(2000, 3000));
  247. if loggedin then
  248. writeln('we loggedin!');
  249. end;
  250. loginplayer;
  251. end;
  252.  
  253. procedure enterlobby;
  254. begin
  255. WRITELN('we are on lobbyscreen!');
  256. MouseBox(280, 300, 480, 375, mouse_Left);
  257. wait(randomrange(2000, 3000));
  258. if loggedin then
  259. writeln('we loggedin!');
  260. end;
  261.  
  262. procedure loginloop;
  263. var
  264. CurrentWorld2, CurrentWorld3: Integer;
  265. begin
  266. if (LobbyScreen) then
  267. begin
  268. WRITELN('we are on lobbyscreen!');
  269. MouseBox(280, 300, 480, 375, mouse_Left);
  270. wait(randomrange(2000, 3000));
  271. if loggedin then
  272. writeln('we loggedin!');
  273. end;
  274. if (Hopworlds = true) then
  275. begin
  276. CurrentWorld2 := CurrentWorldLS;
  277. OpenWorldScreen;
  278. repeat
  279. if (LobbyScreen) then
  280. begin
  281. WRITELN('we are on lobbyscreen!');
  282. MouseBox(280, 300, 480, 375, mouse_Left);
  283. wait(randomrange(2000, 3000));
  284. if loggedin then
  285. writeln('we loggedin!');
  286. end;
  287. if whitecolor then
  288. break;
  289. if loggedin then
  290. exit;
  291. if whitecolor then
  292. writeln('Found the white color for worlds');
  293. if not whitecolor then
  294. writeln('Cant find the White color for worlds');
  295. if not WorldScreen then
  296. exit;
  297. if loggedin then
  298. exit;
  299. case random(10) of
  300. 0..2: mouse(randomrange(397, 554), randomrange(78, 394), 1, 1, mouse_move);
  301. 3..4: mouse(randomrange(298, 462), randomrange(200, 392), 1, 1, mouse_move);
  302. 5..6: mouse(randomrange(205, 555), randomrange(80, 154), 1, 1, mouse_move);
  303. 7..10: mouse(randomrange(211, 555), randomrange(246, 367), 1, 1, mouse_move);
  304. end;
  305. if not WorldScreen then
  306. if not WorldScreen then
  307. exit;
  308. until (whitecolor);
  309. if not WorldScreen then
  310. exit;
  311. if whitecolor then
  312. begin
  313. clickmouse2(mouse_left);
  314. waithumanclick;
  315. currentworld;
  316. waithumanclick;
  317. if (CurrentWorldLS = 365) then
  318. exit;
  319. CurrentWorld3 := CurrentWorldLS;
  320. waithumanclick;
  321. if (CurrentWorld2 <> CurrentWorld3) then
  322. begin
  323. loginplayer;
  324. MakeCompass('n');
  325. setangle(0);
  326. exit;
  327. end;
  328. end;
  329. end
  330. else
  331. DoNormalLogin;
  332. end;
  333.  
  334. function PrayerLevel: integer;
  335. var
  336. s: string;
  337. CurrentHpLevel: integer;
  338. begin
  339. s := GetTextAtExWrap(520, 90, 540, 115, 0, 5, 1, 65280, 0, statchars07);
  340. CurrentHpLevel := StrToIntDef(GetNumbers(s), - 1);
  341. if (CurrentHpLevel > 0) then
  342. begin
  343. result := CurrentHpLevel
  344. end;
  345. end;
  346.  
  347. function AbsorPoints: integer;
  348. var
  349. s: string;
  350. CurrentHpLevel: integer;
  351. begin
  352. s := GetTextAtExWrap(20, 35, 60, 60, 0, 5, 1, 16777215, 0, NMZ);
  353. CurrentHpLevel := StrToIntDef(GetNumbers(s), - 1);
  354. if (CurrentHpLevel > 0) then
  355. begin
  356. result := CurrentHpLevel
  357. end;
  358. end;
  359.  
  360. function FindObject(Color: TintegerArray; Tol, CTS: integer; hMoD, sMoD: extended; split, sort: integer; Uptext: array of string; WaitUptextWait, WaitUptextRandom: Integer; x, y, xs, ys: integer): boolean;
  361. var
  362. III, i, tmpcts: integer;
  363. TPA: tpointarray;
  364. TPAA: T2DPointArray;
  365. begin
  366. if (not (loggedin)) then
  367. exit;
  368. gametab(tab_inv);
  369. tmpcts := GetColorToleranceSpeed;
  370. ColorToleranceSpeed(CTS);
  371. SetColorSpeed2Modifiers(hMoD, SMoD);
  372. FindColorsSpiralTolerance(MSCX, MSCY, TPA, color[III], x, y, xs, ys, Tol) ColorToleranceSpeed(tmpCTS);
  373. SetColorSpeed2Modifiers(0.2, 0.2);
  374. SplitTPAWrap(TPA, split, TPAA);
  375. SortATPAFromSize(TPAA, sort, true);
  376. for I := 0 to High(TPAA) do
  377. begin
  378. MiddleTPAEx(TPAA[i], X, Y);
  379. MMouse(x, y, RandomRange( - 3, 3), RandomRange( - 3, 3));
  380. if WaitUpTextMulti2(uptext, WaitUptextWait + random(WaitUptextRandom)) then
  381. begin
  382. Result := True;
  383. break;
  384. end;
  385. break;
  386. end;
  387. end;
  388.  
  389. function HpLevel: integer;
  390. var
  391. s: string;
  392. CurrentHpLevel: integer;
  393. begin
  394. if not LoggedIn then
  395. exit;
  396. if not InsideCave then
  397. exit;
  398. s := GetTextAtExWrap(520, 50, 540, 70, 0, 5, 1, 65280, 0, statchars07);
  399. CurrentHpLevel := StrToIntDef(GetNumbers(s), - 1);
  400. if (CurrentHpLevel > 0) then
  401. begin
  402. result := CurrentHpLevel
  403. end;
  404. end;
  405.  
  406. procedure Termination(const Status: string);
  407. begin
  408. if (TermCheck = false) then
  409. exit;
  410. writeln(Status);
  411. if loggedin then
  412. begin
  413. if WaitFunc(@ LogOut, 500, RandomRange(8000, 20000)) then
  414. terminatescript
  415. else
  416. terminatescript;
  417. end
  418. else
  419. terminatescript;
  420. end;
  421.  
  422. function logmeout: boolean;
  423. begin
  424. writeln('Logging out..');
  425. if WaitFunc(@ LogOut, 500, RandomRange(8000, 20000)) then
  426. begin
  427. writeln('We have managed to log out');
  428. result := true;
  429. end
  430. else
  431. termination('We have failed to log out, ending script');
  432. end;
  433.  
  434. procedure StartTime;
  435. begin
  436. Timer := GetTimeRunning + RandomRange(BreakTime1 * 60000, BreakTime2 * 60000);
  437. end;
  438.  
  439. procedure LongBreakTimer;
  440. begin
  441. SleepTimer := GetTimeRunning + RandomRange(SleepBreak1 * 3600000, SleepBreak2 * 3600000);
  442. end;
  443.  
  444. procedure breakwait;
  445. begin
  446. waithumanclick;
  447. R_FindNormalRandoms;
  448. if R_inPolygon([point(2635, 3130), point(2635, 3100), point(2598, 3100), point(2598, 3130)]) and loggedin then
  449. begin
  450. R_FindNormalRandoms;
  451. if LogMeOut then
  452. writeln('we managed to log out.. for the break');
  453. end;
  454. if InsideCave then
  455. waithumanclick;
  456. if not loggedin then
  457. WaitHumanClick;
  458. end;
  459.  
  460. procedure TakeBreaks;
  461. var
  462. T, BreakTimer, BreakTimer2: integer;
  463. begin
  464. WaitHumanClick;
  465. writeln('1');
  466. if (GetTimeRunning >= SleepTimer) then
  467. begin
  468. LongBreakTimer;
  469. BreakTimer2 := Randomrange(SleepWait1 * 3600000, SleepWait2 * 3600000);
  470. MarkTime(T);
  471. writeln('It is time to take a LONG break');
  472. Writeln('Time we started the break: ' + (thetime));
  473. WriteLn('Breaking for: ' + (MsToTime(BreakTimer2, Time_Formal)));
  474. repeat
  475. WaitHumanClick;
  476. breakwait;
  477. if (TimeFromMark(t) >= BreakTimer2) then
  478. break;
  479. until (TimeFromMark(T) >= BreakTimer2);
  480. if (TimeFromMark(t) >= BreakTime2) then
  481. begin
  482. writeln('breaking is done.. Back to the script');
  483. LongBreakTimer;
  484. end;
  485. end;
  486. if (GetTimeRunning >= Timer) then
  487. begin
  488. StartTime;
  489. BreakTimer := Randomrange(BreakWait1 * 60000, BreakWait2 * 60000);
  490. writeln('It is time to take a break');
  491. Writeln('Time we started the break: ' + (thetime));
  492. WriteLn('Breaking for: ' + (MsToTime(BreakTimer, Time_Formal)));
  493. MarkTime(t);
  494. writeln('breaking....');
  495. repeat
  496. WaitHumanClick;
  497. breakwait;
  498. if (TimeFromMark(t) >= BreakTimer) then
  499. break;
  500. until (TimeFromMark(T) >= BreakTimer);
  501. if (TimeFromMark(t) >= BreakTimer) then
  502. begin
  503. writeln('breaking is done.. Back to the script');
  504. StartTime;
  505. end;
  506. end;
  507. end;
  508.  
  509. procedure ProgressReport;
  510. var
  511. Total, timeleft, Timeleft2, Timeleft3, timegone, Def3, Att2, Def2, Str2, Hp2, HpPerHour, DefPH, AttPh, StrPh: integer;
  512. begin
  513. if (not (loggedin)) then
  514. exit;
  515. ClearDebug;
  516. timegone := (GetTimeRunning / 1000);
  517. Att2 := (R_GetSkillExp(SKILL_ATTACK) - Att1);
  518. Def2 := (R_GetSkillExp(SKILL_DEFENCE) - Def1);
  519. Str2 := (R_GetSkillExp(SKILL_STRENGTH) - str1);
  520. Hp2 := (R_GetSkillExp(SKILL_HITPOINTS) - Hp1);
  521. Def3 := R_GetSkillExp(SKILL_DEFENCE);
  522. timeleft := ((Timer) - (GetTimeRunning));
  523. if (timeleft) < 0 then
  524. StartTime;
  525. Timeleft2 := ((SleepTimer) - (GetTimeRunning));
  526. Timeleft3 := ((SpecTimer) - (GetTimeRunning));
  527. TimeTillBreak := (MsToTime(timeleft, Time_Formal));
  528. TimeTillLongBreak := (MsToTime(Timeleft2, Time_Formal));
  529. TimeTillSpec := (MsToTime(Timeleft3, Time_Formal));
  530. HpPerHour := (3600 * (Hp2)) / ((timegone));
  531. AttPh := (3600 * (Att2)) / ((timegone));
  532. StrPh := (3600 * (STr2)) / ((timegone));
  533. DefPh := (3600 * (Def2)) / ((timegone));
  534. if (HpPerHour <> 0) then
  535. Total := ((13034431 - Def3) / DefPh);
  536. WriteLn('* NMZ');
  537. WriteLn('* Runtime: ' + TimeRunning);
  538. Writeln('*');
  539. writeln('* Att EXP Gained: ' + IntToStr(Att2) + ' Att Exp P/H: ' + IntToStr(Attph));
  540. writeln('* Str ExP Gained: ' + IntToStr(Str2) + ' str Exp P/H: ' + IntToStr(StrPh));
  541. writeln('* Def ExP Gained: ' + IntToStr(Def2) + ' Def Exp P/H: ' + IntToStr(DefPh));
  542. writeln('* Hp ExP Gained: ' + IntToStr(Hp2) + ' Hp Exp P/H: ' + IntToStr(HpPerHour));
  543. Writeln('* Time till flat 99s ' + IntToSTr(Total));
  544. Writeln('* Time till break : ' + (TimeTillBreak));
  545. Writeln('* Time till LONG break : ' + (TimeTillLongBreak));
  546. end;
  547.  
  548. procedure clickoverload;
  549. begin
  550. if not loggedin then
  551. exit;
  552. if not insidecave then
  553. exit;
  554. writeln('we are here1');
  555. gametab(tab_inv);
  556. case random(10) of
  557. 0..6: writeln('not waiting for overload...continue');
  558. 7..10: WaitAfterOverLoadClick;
  559. end;
  560. if FindObject([921106], 1, 2, 0.00, 3.41, 1, 1, ['Drink', 'rink', 'verload', 'Overload'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
  561. begin
  562. writeln('yes!');
  563. clickmouse2(mouse_left);
  564. wait(randomrange(5000, 10000));
  565. end;
  566. end;
  567.  
  568. procedure clickAbsorp;
  569. begin
  570. if not loggedin then
  571. exit;
  572. if not insidecave then
  573. exit;
  574. gametab(tab_inv);
  575. case random(10) of
  576. 0..6:
  577. begin
  578. if FindObject([11248528], 15, 2, 0.05, 0.27, 1, 1, ['Drink', 'rink', 'Absoprtion', 'bsorption'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
  579. clickmouse2(mouse_left);
  580. if FindObject([11248528], 15, 2, 0.05, 0.27, 1, 1, ['Drink', 'rink', 'Absoprtion', 'bsorption'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
  581. clickmouse2(mouse_left);
  582. if FindObject([11248528], 15, 2, 0.05, 0.27, 1, 1, ['Drink', 'rink', 'Absoprtion', 'bsorption'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
  583. clickmouse2(mouse_left);
  584. DrinkTime := Randomrange(400, 800);
  585. end;
  586. 7..8:
  587. begin
  588. if FindObject([11248528], 15, 2, 0.05, 0.27, 1, 1, ['Drink', 'rink', 'Absoprtion', 'bsorption'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
  589. clickmouse2(mouse_left);
  590. if FindObject([11248528], 15, 2, 0.05, 0.27, 1, 1, ['Drink', 'rink', 'Absoprtion', 'bsorption'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
  591. clickmouse2(mouse_left);
  592. DrinkTime := Randomrange(400, 800);
  593. end;
  594. 9..10:
  595. begin
  596. if FindObject([11248528], 15, 2, 0.05, 0.27, 1, 1, ['Drink', 'rink', 'Absoprtion', 'bsorption'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
  597. clickmouse2(mouse_left);
  598. DrinkTime := Randomrange(400, 800);
  599. end;
  600. end;
  601. end;
  602.  
  603. function Ispraying: Boolean;
  604. var
  605. overhead: tpointarray;
  606. begin
  607. if (not (loggedin)) then
  608. exit;
  609. result := (FindColorsTolerance(Overhead, 63226, MSX1, MSY1, MSX2, MSY2, 10) or FindColorsTolerance(Overhead, 621348, MSX1, MSY1, MSX2, MSY2, 10))
  610. end;
  611.  
  612. function Clickobject(Objpoint: tpoint; Uptext: TStringArray; MaxDistance, RunOffSetX, RunOffsetY: integer): Boolean;
  613. var
  614. Bp, Booth: TPoint;
  615. begin
  616. if (not LoggedIn) then
  617. Exit;
  618. if R_DistanceFromTile(Objpoint) > MaxDistance then
  619. begin
  620. Bp.x := Objpoint.x + RunOffsetX;
  621. Bp.Y := Objpoint.y + RunOffsetY;
  622. R_WalkPath([Bp]);
  623. WaitHumanClick;
  624. end;
  625. if R_DistanceFromTile(Objpoint) < 5 then
  626. begin
  627. Booth := R_TileToMs(ObjPoint);
  628. MMouse(Booth.X, Booth.Y, 3, 3);
  629. waithumanclick;
  630. if (R_IsUpTextMulti(Uptext)) then
  631. begin
  632. result := true;
  633. end;
  634. end;
  635. end;
  636.  
  637. function MMouseObject(Objpoint: tpoint; Uptext: TStringArray): Boolean;
  638. var
  639. Booth: TPoint;
  640. begin
  641. if (not LoggedIn) then
  642. Exit;
  643. Booth := R_TileToMS(ObjPoint);
  644. MMouse(Booth.X, Booth.Y, 2, 2);
  645. Sleep(100 + Random(100));
  646. if (R_IsUpTextMulti(Uptext)) then
  647. begin
  648. result := true;
  649. end;
  650. end;
  651.  
  652. function LocateNPC(Name, Uptext: string): boolean;
  653. var
  654. Bp, Tp: Tpoint;
  655. NpcName: tnpc;
  656. begin
  657. if R_FindNpc(Name, NpcName) then
  658. begin
  659. if NpcName.InCombat then
  660. exit;
  661. Tp := NpcName.Tile;
  662. if R_DistanceFromTile(Tp) > 3 then
  663. begin
  664. Bp.x := Tp.x + 1;
  665. Bp.Y := Tp.y - 1;
  666. R_WalkPath([Bp]);
  667. waithumanclick;
  668. end;
  669. if R_DistanceFromTile(tp) < 5 then
  670. begin
  671. Tp := R_TileToMs(Tp);
  672. Mmouse(Tp.x, Tp.y, 0, 0);
  673. if R_WaitUptext(Uptext, 200) then
  674. begin
  675. result := true;
  676. end;
  677. end;
  678. end;
  679. end;
  680.  
  681. function ShopScreenS: Boolean;
  682. begin
  683. if not loggedin then
  684. exit;
  685. Result := (FindTextTPA(2070783, 10, 22, 30, 476, 52, 'Store', 'UpChars07', Nothing) or (GetColor(482, 36) = 65536));
  686. end;
  687.  
  688. function DreamStartScreen: Boolean;
  689. begin
  690. if not loggedin then
  691. exit;
  692. if not OutsideCave then
  693. exit;
  694. Result := FindTextTPA(668230, 0, 375, 270, 430, 305, 'Accept', 'smallchars07', nothing);
  695. end;
  696.  
  697. function OverloadsPoints(MinPoints: integer): boolean;
  698. var
  699. s: string;
  700. Points: integer;
  701. begin
  702. if not loggedin then
  703. exit;
  704. if not shopscreens then
  705. exit;
  706. wait(randomrange(200, 400));
  707. s := GetTextAtExWrap(175, 215, 208, 235, 0, 5, 1, 16777215, 0, SmallChars07);
  708. Points := StrToIntDef(GetNumbers(s), - 1);
  709. writeln(points);
  710. if (Points < MinPoints) then
  711. begin
  712. result := true;
  713. end;
  714. end;
  715.  
  716. function AbsorpPoints(MinPoints: integer): Boolean;
  717. var
  718. s: string;
  719. Points: integer;
  720. begin
  721. if not loggedin then
  722. exit;
  723. if not shopscreens then
  724. exit;
  725. wait(randomrange(200, 400));
  726. s := GetTextAtExWrap(242, 215, 272, 236, 0, 5, 1, 16777215, 0, SmallChars07);
  727. writeln(s);
  728. Points := StrToIntDef(GetNumbers(s), - 1);
  729. writeln(points);
  730. if (Points < MinPoints) then
  731. begin
  732. result := true;
  733. end;
  734. end;
  735.  
  736. function Absorbed: boolean;
  737. begin
  738. if not loggedin then
  739. exit;
  740. if not insidecave then
  741. exit;
  742. result := FindTextTPAMulti(2070783, 0, MSX1, MSY1, MSX2, MSY2, ['Absorption'], StatChars07, nothing);
  743. end;
  744.  
  745. procedure fleeFromFight;
  746. begin
  747. if not LoggedIn then
  748. exit;
  749. if not PIdle then
  750. exit;
  751. if insidecave then
  752. exit;
  753. writeln('we are in combat outside cave!');
  754. if OutsideCave then
  755. begin
  756. writeln('running path away from random!');
  757. R_WalkPath([Point(2601, 3115), Point(2606, 3115), Point(2608, 3120), Point(2609, 3125), Point(2609, 3130)]);
  758. Wait(randomrange(2000, 3000));
  759. end;
  760. WaitHumanClick;
  761. writeln('done running!');
  762. if not OutsideCave then
  763. begin
  764. writeln('we ran to safe spot and not in cave area, running back');
  765. R_WalkPath([Point(2609, 3133), Point(2609, 3128), Point(2609, 3123), Point(2608, 3118), Point(2604, 3115)]);
  766. Wait(randomrange(2000, 3000));
  767. if OutsideCave then
  768. begin
  769. writeln('we made it back to the dream area.. Resuming script!');
  770. waithumanclick;
  771. if IsInFight then
  772. Termination('we are still in fight.. Going to termiante the script, we probably will fail to log out');
  773. end
  774. else
  775. Termination('we got lost while trying to return to the dream area.. ending script');
  776. end;
  777. end;
  778.  
  779. procedure clickCoffer;
  780. begin
  781. if not loggedin then
  782. exit;
  783. if not loggedin then
  784. exit;
  785. if IsInFight then
  786. fleeFromFight;
  787. if Clickobject(point(CofferX, CofferY), ['Unlock'], 5, 1, - 1) then
  788. begin
  789. writeln('clicking coffer');
  790. FindALlrandoms;
  791. waithumanclick;
  792. clickmouse2(mouse_left);
  793. waithumanclick;
  794. if not loggedin then
  795. exit;
  796. if IsInFight then
  797. fleeFromFight;
  798. if WaitFunc(@ Pinscreen, 500, randomrange(8000, 10000)) then
  799. begin
  800. InPin(bankpin);
  801. if not loggedin then
  802. exit;
  803. if IsInFight then
  804. fleeFromFight;
  805. end;
  806. if not loggedin then
  807. exit;
  808. if IsInFight then
  809. fleeFromFight;
  810. end;
  811. end;
  812.  
  813. procedure DoChest;
  814. begin
  815. V := [['Enter amount', 'Enter', 'nter', 'amount', 'mount'], nothing];
  816. if not loggedin then
  817. exit;
  818. if IsInFight then
  819. fleeFromFight;
  820. if (R_InvCount = 28) then
  821. exit;
  822. if Clickobject(point(ChestX, ChestY), ['chest'], 4, 0, - 2) then
  823. begin
  824. writeln(' clicking chest');
  825. FindALlrandoms;
  826. clickmouse2(mouse_left);
  827. waithumanclick;
  828. if not loggedin then
  829. exit;
  830. if IsInFight then
  831. fleeFromFight;
  832. if WaitFunc(@ pinscreen, 500, RandomRange(8000, 10000)) then
  833. begin
  834. writeln(' entering pin');
  835. InPin(bankpin);
  836. end;
  837. waithumanclick;
  838. if not loggedin then
  839. exit;
  840. if IsInFight then
  841. fleeFromFight;
  842. if WaitFunc(@ ShopScreenS, 500, RandomRange(8000, 10000)) then
  843. begin
  844. mouse(250, 70, 3, 3, mouse_left);
  845. WaitHumanClick;
  846. if not loggedin then
  847. exit;
  848. if IsInFight then
  849. fleeFromFight;
  850. if OverloadsPoints(36) then
  851. begin
  852. writeln('we dont have enough overloads in the barrel.. buying more');
  853. mouse(185, 185, 3, 3, mouse_right);
  854. WaitHumanClick;
  855. WaitOptionMulti(['Buy-X'], 500);
  856. WaitHumanClick;
  857. if not loggedin then
  858. exit;
  859. if IsInFight then
  860. fleeFromFight;
  861. if WaitFuncEx('FindNPCChatTextMulti', V, 500, RandomRange(8000, 10000)) then
  862. TypeSendEx('255', true);
  863. waithumanclick;
  864. end;
  865. if AbsorpPoints(72) then
  866. begin
  867. mouse(255, 188, 3, 3, mouse_right);
  868. WaitHumanClick;
  869. WaitOptionMulti(['Buy-X'], 500);
  870. WaitHumanClick;
  871. if not loggedin then
  872. exit;
  873. if IsInFight then
  874. fleeFromFight;
  875. if WaitFuncEx('FindNPCChatTextMulti', V, 500, RandomRange(8000, 10000)) then
  876. TypeSendEx('255', true);
  877. end;
  878. if ShopScreens then
  879. mouse(randomrange(486, 487), randomrange(40, 41), 0, 0, mouse_left);
  880. FindALlrandoms;
  881. if not loggedin then
  882. exit;
  883. if IsInFight then
  884. fleeFromFight;
  885. end;
  886. end;
  887. end;
  888.  
  889. procedure WithdrawOverloads;
  890. begin
  891. V := [['please'], clickleft];
  892. if not loggedin then
  893. exit;
  894. if IsInFight then
  895. fleeFromFight;
  896. if (R_InvCount < 28) then
  897. begin
  898. if not loggedin then
  899. exit;
  900. if IsInFight then
  901. fleeFromFight;
  902. MakeCompass('w');
  903. writeln(' we dont have overloads');
  904. if Clickobject(point(BarrelOX, BarrelOY), ['Overload'], 5, 1, 0) then
  905. begin
  906. if not loggedin then
  907. exit;
  908. if IsInFight then
  909. fleeFromFight;
  910. FindALlrandoms;
  911. writeln(' getting overloads');
  912. if FindObject([921106], 1, 2, 0.00, 3.41, 1, 1, ['Drink', 'rink', 'verload', 'Overload'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
  913. begin
  914. if not loggedin then
  915. exit;
  916. if IsInFight then
  917. fleeFromFight;
  918. writeln('we have overloads in inv, storing them');
  919. if Clickobject(point(BarrelOX, BarrelOY), ['Overload'], 5, 1, - 1) then
  920. clickmouse2(mouse_right);
  921. waithumanclick;
  922. WaitOptionMulti(['Store', 'tore'], 3000);
  923. waithumanclick;
  924. if WaitFuncEx('FindNPCChatTextMulti', V, 500, RandomRange(8000, 10000)) then
  925. writeln('we clicked yes to store overloads');
  926. waithumanclick;
  927. if not loggedin then
  928. exit;
  929. if IsInFight then
  930. fleeFromFight;
  931. end;
  932. if Clickobject(point(BarrelOX, BarrelOY), ['Overload'], 5, 2, - 1) then
  933. clickmouse2(mouse_right);
  934. WaitOptionMulti(['Take'], 3000);
  935. WaitHumanClick;
  936. V := [['Many', 'any'], move];
  937. if WaitFuncEx('FindNPCChatTextMulti', V, 500, RandomRange(8000, 10000)) then
  938. TypeSendEx(Overloads, true);
  939. WaitHumanClick;
  940. if not loggedin then
  941. exit;
  942. if IsInFight then
  943. fleeFromFight;
  944. end;
  945. end;
  946. end;
  947.  
  948. procedure withdrawabsorbs;
  949. begin
  950. V := [['please'], clickleft];
  951. if not loggedin then
  952. exit;
  953. if IsInFight then
  954. fleeFromFight;
  955. if (R_InvCount < 28) then
  956. begin
  957. MakeCompass('w');
  958. writeln(' we dont have absorbs');
  959. if not loggedin then
  960. exit;
  961. if IsInFight then
  962. fleeFromFight;
  963. if Clickobject(point(BarrelAX, BarrelAY), ['Absorption'], 4, 1, 0) then
  964. begin
  965. FindALlrandoms;
  966. writeln(' getting absorb');
  967. MakeCompass('w');
  968. if FindObject([10852996], 20, 2, 0.03, 0.35, 1, 1, ['Drink', 'rink', 'verload', 'Overload'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
  969. begin
  970. writeln('we have absorbs in inv, storing them');
  971. if not loggedin then
  972. exit;
  973. if IsInFight then
  974. fleeFromFight;
  975. if Clickobject(point(BarrelAX, BarrelAY), ['Absorption'], 5, 2, - 1) then
  976. clickmouse2(mouse_right);
  977. WaitOptionMulti(['Store', 'tore'], 3000);
  978. WaitHumanClick;
  979. if WaitFuncEx('FindNPCChatTextMulti', V, 500, RandomRange(8000, 10000)) then
  980. writeln('we clicked yes to store absorp');
  981. waithumanclick;
  982. if not loggedin then
  983. exit;
  984. if IsInFight then
  985. fleeFromFight;
  986. end;
  987. if Clickobject(point(BarrelAX, BarrelAY), ['Absorption'], 5, 2, - 1) then
  988. clickmouse2(mouse_right);
  989. WaitOptionMulti(['Take'], 3000);
  990. WaitHumanClick;
  991. if not loggedin then
  992. exit;
  993. if IsInFight then
  994. fleeFromFight;
  995. WaitHumanClick;
  996. V := [['Many', 'any'], move];
  997. if WaitFuncEx('FindNPCChatTextMulti', V, 500, RandomRange(8000, 10000)) then
  998. TypeSendEx(Absorbs, true);
  999. WaitHumanClick;
  1000. writeln(' failed to withdraw absorbs');
  1001. if not loggedin then
  1002. exit;
  1003. if IsInFight then
  1004. fleeFromFight;
  1005. end;
  1006. end;
  1007. end;
  1008.  
  1009. procedure StartDream;
  1010. begin
  1011. if not loggedin then
  1012. exit;
  1013. if IsInFight then
  1014. fleeFromFight;
  1015. if LocateNPC('Dominic', 'Dominic') then
  1016. begin
  1017. FindALlrandoms;
  1018. writeln(' finding dominic and starting dream');
  1019. waithumanclick;
  1020. ClickMouse2(mouse_right);
  1021. WaitOptionMulti(['Dream', 'ream'], 500);
  1022. waithumanclick;
  1023. if not loggedin then
  1024. exit;
  1025. if IsInFight then
  1026. fleeFromFight;
  1027. V := [ClBlack, 30, MCX1, MCY1, MCX2, MCY2, 'Previous', CharsNPC07, Nothing];
  1028. if WaitFuncEx('FindTextTPA', V, 500, randomrange(8000, 10000)) then
  1029. begin
  1030. mouse(260, 445, 2, 2, mouse_left);
  1031. wait(randomrange(1500, 2500));
  1032. ClickToContinue;
  1033. wait(randomrange(1500, 2500));
  1034. mouse(260, 402, 2, 2, mouse_left);
  1035. if not loggedin then
  1036. exit;
  1037. if IsInFight then
  1038. fleeFromFight;
  1039. case random(10) of
  1040. 0..7: writeln('done dream');
  1041. 8..10:
  1042. begin
  1043. writeln('clicking continue after done..');
  1044. waithumanclick;
  1045. ClickToContinue;
  1046. waithumanclick;
  1047. if not loggedin then
  1048. exit;
  1049. if IsInFight then
  1050. fleeFromFight;
  1051. end;
  1052. end;
  1053. end;
  1054. end;
  1055. end;
  1056.  
  1057. procedure CheckIfVialempty;
  1058. begin
  1059. if not loggedin then
  1060. exit;
  1061. if IsInFight then
  1062. fleeFromFight;
  1063. if DreamStartScreen then
  1064. Mousebox(456, 45, 466, 51, mouse_left);
  1065. if ShopScreenS then
  1066. mouse(randomrange(486, 487), randomrange(40, 41), 0, 0, mouse_left);
  1067. if Clickobject(point(VialX, VialY), ['Empty'], 5, 0, - 1) then
  1068. begin
  1069. writeln(' Vial is empty');
  1070. MakeCompass('n');
  1071. SetAngle(0);
  1072. writeln('going for chest to buy potions');
  1073. if not loggedin then
  1074. exit;
  1075. if IsInFight then
  1076. fleeFromFight;
  1077. DoChest;
  1078. if not loggedin then
  1079. exit;
  1080. if IsInFight then
  1081. fleeFromFight;
  1082. WithdrawOverloads;
  1083. if not loggedin then
  1084. exit;
  1085. if IsInFight then
  1086. fleeFromFight;
  1087. withdrawabsorbs;
  1088. if not loggedin then
  1089. exit;
  1090. if IsInFight then
  1091. fleeFromFight;
  1092. StartDream;
  1093. if not loggedin then
  1094. exit;
  1095. if IsInFight then
  1096. fleeFromFight;
  1097. end;
  1098. end;
  1099.  
  1100. procedure Checkifvialisfull;
  1101. begin
  1102. if not loggedin then
  1103. exit;
  1104. if IsInFight then
  1105. fleeFromFight;
  1106. if DreamStartScreen then
  1107. Mousebox(456, 45, 466, 51, mouse_left);
  1108. if ShopScreenS then
  1109. mouse(randomrange(486, 487), randomrange(40, 41), 0, 0, mouse_left);
  1110. if Clickobject(point(VialX, VialY), ['Potion'], 4, 0, - 1) then
  1111. begin
  1112. if not loggedin then
  1113. exit;
  1114. if IsInFight then
  1115. fleeFromFight;
  1116. FindALlrandoms;
  1117. if not loggedin then
  1118. exit;
  1119. if IsInFight then
  1120. fleeFromFight;
  1121. writeln(' our dream is ready, starting');
  1122. clickmouse2(mouse_left);
  1123. waithumanclick;
  1124. if not loggedin then
  1125. exit;
  1126. if IsInFight then
  1127. fleeFromFight;
  1128. MouseBox(435, 280, 455, 299, mouse_move);
  1129. if WaitUpTextMulti2(['Continue', 'ontinue'], 3000) then
  1130. begin
  1131. clickmouse2(mouse_left);
  1132. writeln(' waiting 10...10 seconds');
  1133. if WaitFunc(@ InsideCave, 500, RandomRange(15000, 20000)) then
  1134. begin
  1135. if not loggedin then
  1136. exit;
  1137. if IsInFight and (not InsideCave) then
  1138. fleeFromFight;
  1139. writeln(' getting our position');
  1140. PointInsideCave := R_GetTileGlobal;
  1141. writeln(' mapping our 44X44 area');
  1142. if (PointInsideCave.x > 0) then
  1143. begin
  1144. writeln('it mapped correctly!');
  1145. Cavebottomleft.x := PointInsideCave.x - 44;
  1146. Cavebottomleft.y := PointInsideCave.y - 4;
  1147. Cavetopleft.x := PointInsideCave.X - 44;
  1148. Cavetopleft.y := PointInsideCave.Y + 44;
  1149. CaveBottomRight.x := PointInsideCave.X + 44;
  1150. CaveBottomRight.y := PointInsideCave.Y - 4;
  1151. CavetopRight.x := PointInsideCave.X + 44;
  1152. CavetopRight.y := PointInsideCave.y + 44;
  1153. end
  1154. else
  1155. writeln('failed to map our area');
  1156. end;
  1157. end
  1158. else
  1159. clickCoffer;
  1160. end;
  1161. end;
  1162.  
  1163. procedure outsideloop;
  1164. begin
  1165. if not loggedin then
  1166. exit;
  1167. if IsInFight then
  1168. fleeFromFight;
  1169. FindALlrandoms;
  1170. if DreamStartScreen then
  1171. Mousebox(456, 45, 466, 51, mouse_left);
  1172. if ShopScreenS then
  1173. mouse(randomrange(486, 487), randomrange(40, 41), 0, 0, mouse_left);
  1174. MakeCompass('n');
  1175. SetAngle(0);
  1176. writeln('we are outside NMZ...');
  1177. if IsInFight then
  1178. fleeFromFight;
  1179. clickCoffer;
  1180. if IsInFight then
  1181. fleeFromFight;
  1182. writeln('going for vial..');
  1183. CheckIfVialEmpty;
  1184. if IsInFight then
  1185. fleeFromFight;
  1186. CheckifvialisFull;
  1187. if IsInFight then
  1188. fleeFromFight;
  1189. end;
  1190.  
  1191. procedure WaitShortClick;
  1192. begin
  1193. if (not (loggedin)) then
  1194. exit;
  1195. case random(600) of
  1196. 1..450: Wait(RandomRange(100, 150));
  1197. 451..570: Wait(RandomRange(150, 200));
  1198. 571..590: Wait(RandomRange(200, 250));
  1199. 591..600: Wait(RandomRange(250, 400));
  1200. end;
  1201. end;
  1202.  
  1203. procedure WaitShortClick2;
  1204. begin
  1205. if (not (loggedin)) then
  1206. exit;
  1207. case random(600) of
  1208. 1..450: Wait(RandomRange(400, 450));
  1209. 451..570: Wait(RandomRange(450, 500));
  1210. 571..590: Wait(RandomRange(500, 550));
  1211. 591..600: Wait(RandomRange(550, 600));
  1212. end;
  1213. end;
  1214.  
  1215. function HoverNearbyNpc: boolean;
  1216. var
  1217. I: Tpointarray;
  1218. P: Integer;
  1219. begin
  1220. if (not (loggedin)) then
  1221. exit;
  1222. I := GetMiniMapDots('npc');
  1223. if (length(I) > 0) then
  1224. begin
  1225. SortTPAFrom(i, Point(MMCX, MMCY));
  1226. P := random(length(I)) Mmouse(I[0].x, I[0].y, 3, 3);
  1227. result := true;
  1228. end;
  1229. end;
  1230.  
  1231. procedure Keyboards;
  1232. begin
  1233. case random(5) of
  1234. 0..2:
  1235. begin
  1236. KeyDown(37);
  1237. WaitShortClick KeyUp(37);
  1238. WaitShortClick KeyDown(40);
  1239. WaitShortClick KeyUp(40);
  1240. end;
  1241. 3..4:
  1242. begin
  1243. KeyDown(39);
  1244. WaitShortClick KeyUp(39);
  1245. WaitShortClick KeyDown(38);
  1246. WaitShortClick KeyUp(38);
  1247. end;
  1248. 5:
  1249. begin
  1250. KeyDown(38);
  1251. WaitShortClick KeyUp(38);
  1252. WaitShortClick KeyDown(39);
  1253. WaitShortClick KeyUp(39);
  1254. end;
  1255. end;
  1256. end;
  1257.  
  1258. procedure Antiban;
  1259. begin
  1260. if (not (loggedin)) then
  1261. exit;
  1262. case random(100) of
  1263. 0..56:
  1264. begin
  1265. end;
  1266. 57..100:
  1267. begin
  1268. case random(150) of
  1269. 10: hoverskill(skill_magic, false);
  1270. 15: HoverOnlineFriend;
  1271. 20: BoredHuman;
  1272. 30: MMouseOffClient('top');
  1273. 40: MMouseOffClient('left');
  1274. 50: MMouseOffClient('right');
  1275. 60: MMouseOffClient('bottom');
  1276. 70: SmallRandomMouse;
  1277. 80: RandomAngle(1);
  1278. 90: RandomAngle(2);
  1279. 100: PickUpMouse;
  1280. 110: CompassMovement(10, 70, true);
  1281. 120: HoverNearbyNpc;
  1282. 130: Keyboards;
  1283. 140: MissMouse(250, 250);
  1284. 150: RandomMovement;
  1285. 160: CompassMovement(240, 300, true);
  1286. 170: AdjustMouseSpeed(3, 10, 20);
  1287. 180: RandomFKeys(true);
  1288. 190: RandomTab(true);
  1289. end;
  1290. end;
  1291. end;
  1292. end;
  1293.  
  1294. procedure idle;
  1295. var
  1296. HpBarOutside, t: integer;
  1297. begin
  1298. writeln('entered idle mode..');
  1299. marktime(t);
  1300. HpBarOutside := randomrange(3000, 6000);
  1301. repeat
  1302. wait(400);
  1303. if not InsideCave then
  1304. exit;
  1305. if not loggedin then
  1306. exit;
  1307. if IsInFight then
  1308. exit;
  1309. until (TimeFromMark(T) >= HpBarOutside);
  1310. if (TimeFromMark(T) >= HpBarOutside) then
  1311. begin
  1312. writeln('we entered idling methhod, spinning camera and shit');
  1313. antiban;
  1314. end;
  1315. end;
  1316.  
  1317. procedure SpecTiming;
  1318. begin
  1319. SpecTimer := GetTimeRunning + RandomRange(ReSpecTime1, ReSpecTime2);
  1320. end;
  1321.  
  1322. procedure MakeSpec;
  1323. var
  1324. T, CurrentSpec: integer;
  1325. begin
  1326. SpecTiming;
  1327. CurrentSpec := R_GetSpecPercent;
  1328. gametab(tab_inv);
  1329. if (currentspec < 25) then
  1330. begin
  1331. writeln('we dont have enough spec');
  1332. gametab(tab_inv);
  1333. MMouseItem(1);
  1334. WaitHumanClick;
  1335. if WaitUpTextMulti2(['Whip', 'hip', 'abyssal', 'byssal'], 300) then
  1336. begin
  1337. writeln('No spec, putting whip back on!');
  1338. ClickMouse2(mouse_left);
  1339. WaitHumanClick;
  1340. end;
  1341. end;
  1342. if (currentspec >= 25) then
  1343. begin
  1344. gametab(tab_inv);
  1345. MMouseItem(1);
  1346. WaitHumanClick;
  1347. if WaitUpTextMulti2(['Whip', 'hip', 'abyssal', 'byssal'], 300) then
  1348. begin
  1349. writeln('we dont have whip equipped ..., specing!');
  1350. GameTab(tab_combat);
  1351. WaitHumanClick;
  1352. MouseBox(579, 425, 680, 427, mouse_Move);
  1353. if WaitUpTextMulti2(['Use', 'se'], 300) then
  1354. begin
  1355. marktime(t);
  1356. repeat
  1357. waithumanclick;
  1358. CurrentSpec := R_GetSpecPercent;
  1359. if not loggedin then
  1360. exit;
  1361. if not InsideCave then
  1362. exit;
  1363. if (CurrentSpec < 25) then
  1364. break;
  1365. if not WaitUpTextMulti2(['Use', 'se'], 300) then
  1366. break;
  1367. clickmouse2(mouse_left);
  1368. Wait(randomrange(2000, 3000));
  1369. CurrentSpec := R_GetSpecPercent;
  1370. waithumanclick;
  1371. until (CurrentSpec < 25) or (TimeFromMark(t) >= 20000) writeln('done doing spec');
  1372. if (CurrentSpec < 25) or (TimeFromMark(t) >= 20000) then
  1373. begin
  1374. writeln('no more spec');
  1375. GameTab(tab_inv);
  1376. WaitHumanClick;
  1377. MMouseItem(1);
  1378. WaitHumanClick;
  1379. if WaitUpTextMulti2(['Whip', 'hip', 'abyssal', 'byssal'], 300) then
  1380. begin
  1381. writeln('putting whip back on');
  1382. ClickMouse2(mouse_left);
  1383. WaitHumanClick;
  1384. end;
  1385. end;
  1386. end;
  1387. end;
  1388. if WaitUpTextMulti2(['Drag', 'rag', 'dagger', 'agger'], 300) then
  1389. begin
  1390. writeln('we have whip on, switching to dds!');
  1391. ClickMouse2(mouse_left);
  1392. WaitHumanClick;
  1393. if WaitUpTextMulti2(['Whip', 'hip', 'abyssal', 'byssal'], 300) then
  1394. begin
  1395. GameTab(tab_combat);
  1396. WaitHumanClick;
  1397. MouseBox(579, 425, 680, 427, mouse_Move);
  1398. if WaitUpTextMulti2(['Use', 'se'], 300) then
  1399. begin
  1400. marktime(t);
  1401. repeat
  1402. waithumanclick;
  1403. CurrentSpec := R_GetSpecPercent;
  1404. if not loggedin then
  1405. exit;
  1406. if not InsideCave then
  1407. exit;
  1408. if (CurrentSpec < 25) then
  1409. break;
  1410. if not WaitUpTextMulti2(['Use', 'se'], 300) then
  1411. break;
  1412. clickmouse2(mouse_left);
  1413. Wait(randomrange(2000, 3000));
  1414. CurrentSpec := R_GetSpecPercent;
  1415. waithumanclick;
  1416. until (CurrentSpec < 25) or (TimeFromMark(t) >= 20000) writeln('done doing spec');
  1417. if (CurrentSpec < 25) or (TimeFromMark(t) >= 20000) then
  1418. begin
  1419. writeln('no more spec');
  1420. GameTab(tab_inv);
  1421. WaitHumanClick;
  1422. MMouseItem(1);
  1423. WaitHumanClick;
  1424. if WaitUpTextMulti2(['Whip', 'hip', 'abyssal', 'byssal'], 300) then
  1425. begin
  1426. writeln('putting whip back on');
  1427. ClickMouse2(mouse_left);
  1428. WaitHumanClick;
  1429. end;
  1430. end;
  1431. end;
  1432. end;
  1433. end;
  1434. end;
  1435. end;
  1436.  
  1437. procedure DoSpec;
  1438. begin
  1439. if not loggedin then
  1440. exit;
  1441. if not InsideCave then
  1442. exit;
  1443. if (DoSpecs = false) then
  1444. exit;
  1445. writeln('we are here');
  1446. if (GetTimeRunning >= SpecTimer) then
  1447. begin
  1448. SpecTiming;
  1449. writeln('time to do spec..');
  1450. case random(100) of
  1451. 0..50: writeln('not doing spec this time');
  1452. 51..100: MakeSpec;
  1453. end;
  1454. end;
  1455. end;
  1456.  
  1457. function ReachedGoal(SkillGoal, SkillCompare: Integer): boolean;
  1458. var
  1459. CurrentGoal, ComparedGoal: integer;
  1460. begin
  1461. CurrentGoal := R_GetSkillExp(SkillGoal);
  1462. ComparedGoal := R_GetSkillExp(SkillCompare);
  1463. if (CurrentGoal >= ComparedGoal) then
  1464. begin
  1465. result := true;
  1466. end;
  1467. end;
  1468.  
  1469. function FinishedGoal: boolean;
  1470. var
  1471. SkillAtt, SkillDef, SkillSTr: integer;
  1472. begin
  1473. SkillAtt := R_GetSkillExp(0);
  1474. SkillDef := R_GetSkillExp(1);
  1475. SkillSTr := R_GetSkillExp(2);
  1476. if (SkillAtt >= SkillSTr) and (SkillDef >= SkillSTr) then
  1477. begin
  1478. result := true;
  1479. end;
  1480. end;
  1481.  
  1482. procedure InCaveIdleLoop;
  1483. begin
  1484. WaitHumanClick;
  1485. if not loggedin then
  1486. exit;
  1487. if not InsideCave then
  1488. exit;
  1489. if not R_IsAutoRetaliateOn then
  1490. Retaliate(true);
  1491. progressreport;
  1492. FindALlrandoms;
  1493. if FinishedGoal then
  1494. setfightmode(2);
  1495. if (HpLevel >= 49) then
  1496. clickoverload;
  1497. if (not Absorbed) then
  1498. begin
  1499. if not InsideCave then
  1500. exit;
  1501. if not loggedin then
  1502. exit;
  1503. ClickAbsorp;
  1504. waithumanclick;
  1505. ClickAbsorp;
  1506. waithumanclick;
  1507. ClickAbsorp;
  1508. waithumanclick;
  1509. ClickAbsorp;
  1510. waithumanclick;
  1511. end;
  1512. if (AbsorPoints <= DrinkTime) then
  1513. clickAbsorp;
  1514. if not IsInFight then
  1515. idle;
  1516. end;
  1517.  
  1518. procedure walktosafespot;
  1519. begin
  1520. myposinsidecave.x := PointInsideCave.x + 5;
  1521. myposinsidecave.y := PointInsideCave.y - 1;
  1522. WaitHumanClick;
  1523. FindALlrandoms;
  1524. MeInCave := R_GetTileGlobal;
  1525. r_walkpath([myposinsidecave]);
  1526. waithumanclick;
  1527. end;
  1528.  
  1529. procedure InsideCaveloop;
  1530. begin
  1531. if not loggedin then
  1532. exit;
  1533. if not InsideCave then
  1534. exit;
  1535. if R_inPolygon([CavetopRight, CaveBottomRight, Cavebottomleft, Cavetopleft]) then
  1536. begin
  1537. MeInCave := R_GetTileGlobal;
  1538. if not (MeInCave.x > (PointInsideCave.x + 1)) then
  1539. begin
  1540. walkToSafeSpot;
  1541. end;
  1542. if (MeInCave.x < (PointInsideCave.x + 10)) then
  1543. begin
  1544. while InsideCave do
  1545. InCaveIdleLoop;
  1546. end;
  1547. end
  1548. else
  1549. begin
  1550. while InsideCave do
  1551. InCaveIdleLoop;
  1552. end;
  1553. end;
  1554.  
  1555. procedure mainloop;
  1556. var
  1557. t: integer;
  1558. begin
  1559. if not loggedin then
  1560. exit;
  1561. FindALlrandoms;
  1562. if OutsideCave then
  1563. Outsideloop;
  1564. if InsideCave then
  1565. InsideCaveloop;
  1566. if not loggedin then
  1567. exit;
  1568. FindALlrandoms;
  1569. if (not InsideCave) and (not OutsideCave) then
  1570. begin
  1571. MarkTime(t)
  1572. repeat
  1573. WaitHumanClick;
  1574. if not loggedin then
  1575. exit;
  1576. if (OutsideCave) then
  1577. exit;
  1578. if InsideCave then
  1579. exit;
  1580. FindALlrandoms;
  1581. until (TimeFromMark(T) > 20000);
  1582. if (TimeFromMark(t) > 20000) then
  1583. begin
  1584. if logmeout then
  1585. Termination('We got lost, couldnt find where we were');
  1586. end;
  1587. end;
  1588. end;
  1589.  
  1590. procedure test1;
  1591. begin
  1592. end;
  1593.  
  1594. procedure info;
  1595. var
  1596. Level1, Level2, Level3: string;
  1597. Me1, Me2, me3: integer;
  1598. begin
  1599. Level1 := 'Exp needed to level 90: 5,346,332';
  1600. Level2 := 'Exp needed to level 99: 8,771,558';
  1601. Level3 := 'Exp needed to level 99: 13,034,431';
  1602. me1 := R_GetSkillExp(SKILL_DEFENCE);
  1603. me2 := (((13034431) - (me1)) / 22000);
  1604. writeln('We need : ' + IntToSTr(me2) + ' Hours Till 99');
  1605. end;
  1606.  
  1607. begin
  1608. playerSetup;
  1609. setupsrl;
  1610. SetupReflection;
  1611. writeln(R_GetTileGlobal);
  1612. SRL_CombatRandoms := False;
  1613. R_CombatRandoms := false;
  1614. R_Reincarnate := true;
  1615. if loggedin then
  1616. graboriginalexp;
  1617. StartTime;
  1618. LongBreakTimer;
  1619. SpecTiming;
  1620. addonterminate('progressreport');
  1621. DrinkTime := Randomrange(500, 800);
  1622. if not R_IsAutoRetaliateOn then
  1623. Retaliate(true);
  1624. SetFightMode(2);
  1625. repeat
  1626. WaitHumanClick;
  1627. if pinscreen then
  1628. InPin(bankpin);
  1629. if LobbyScreen then
  1630. enterlobby;
  1631. if not loggedin then
  1632. loginloop;
  1633. if loggedin then
  1634. mainloop;
  1635. until (false);
  1636. end.
Advertisement
Add Comment
Please, Sign In to add comment