zamaro

NMZ script

Apr 20th, 2014
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.11 KB | None | 0 0
  1. program FNmZ;
  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. Str1,Att1,Def1,Hp1: integer;
  11. PointInsideCave: tpoint;
  12. CaveBottomRight, CavetopRight, Cavebottomleft, Cavetopleft: tpoint;
  13.  
  14. const
  15. bankpin = '/'; // your bank pin.
  16. TermCheck = true; // Terminate if lost?.
  17. Absorbs = '36'; // How many Absorb potions to withdraw? put 0 if no absorbs.
  18. Overloads = '72'; // How many overloads to Draw?.
  19. // MeleePrayer = False; // Do you want to use Melee prayers?.
  20.  
  21.  
  22.  
  23.  
  24. procedure playerSetup;
  25. begin
  26. HowManyPlayers := 1;
  27. NumberOfPlayers(HowManyPlayers);
  28. CurrentPlayer := 0;
  29. Players[0].Name := '/';
  30. Players[0].Pass := '/';
  31. Players[0].Nick := '/';
  32. Players[0].Active := True;
  33. end;
  34.  
  35. procedure WaitHumanClick;
  36. begin
  37. case random(600) of
  38. 1..450: Wait(RandomRange(400, 600));
  39. 451..570: Wait(RandomRange(400, 600));
  40. 571..590: Wait(RandomRange(600, 800));
  41. 591..600: Wait(RandomRange(800, 1000));
  42. end;
  43. end;
  44.  
  45. procedure WaitHumanClick2;
  46. begin
  47. case random(600) of
  48. 1..450: Wait(RandomRange(4500, 5000));
  49. 451..570: Wait(RandomRange(5000, 5200));
  50. 571..590: Wait(RandomRange(5200, 5500));
  51. 591..600: Wait(RandomRange(5500, 6000));
  52. end;
  53. end;
  54.  
  55.  
  56.  
  57. procedure WaitHumanClick3;
  58. begin
  59. case random(600) of
  60. 1..450: Wait(RandomRange(3000, 5000));
  61. 451..570: Wait(RandomRange(5000, 5500));
  62. 571..590: Wait(RandomRange(6000, 6500));
  63. 591..600: Wait(RandomRange(7000, 7500));
  64. end;
  65. end;
  66.  
  67. procedure FindALlrandoms;
  68. begin
  69. R_FindNormalRandoms;
  70. FindNonInventoryRandoms;
  71. FindNormalRandoms;
  72. end;
  73.  
  74.  
  75.  
  76.  
  77. function GetGreenUptext: string;
  78. var
  79. WhiteT, BlueT, YellowT, OrangeT, GreenT, FoundText: string;
  80. begin
  81. WhiteT := GetTextAtExWrap(8, 8, 300, 21, 0, 5, 1, 14541281, 55, 'UpChars07');
  82. BlueT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 13423640, 65, 'UpChars07');
  83. YellowT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 1235160, 40, 'UpChars07');
  84. OrangeT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 4687583, 53, 'UpChars07');
  85. GreenT := GetTextAtExWrap(8, 8, 300, 21, 0, 5, 1, 120577, 65, 'UpChars07');
  86. FoundText := WhiteT + ' ' + BlueT + YellowT + OrangeT + GreenT;
  87. FoundText := ReplaceWrap(FoundText, '.', '', [rfReplaceAll]);
  88. FoundText := ReplaceWrap(FoundText, '/', '', [rfReplaceAll]);
  89. FoundText := ReplaceWrap(FoundText, '\', '', [rfReplaceAll]);
  90. FoundText := ReplaceWrap(FoundText, ',', '', [rfReplaceAll]);
  91. FoundText := ReplaceWrap(FoundText, '*', '', [rfReplaceAll]);
  92. FoundText := ReplaceWrap(FoundText, '^', '', [rfReplaceAll]);
  93. FoundText := ReplaceWrap(FoundText, '"', '', [rfReplaceAll]);
  94. Result := FoundText;
  95. end;
  96.  
  97. function IsUpTextMultiCustom2(Text: TStringArray): Boolean;
  98. var
  99. TheText: string;
  100. i, n: Integer;
  101. begin
  102. TheText := GetGreenUptext;
  103. n := High(Text);
  104. for i := 0 to n do
  105. if (Pos(Text[i], TheText) > 0) then
  106. begin
  107. Result := True;
  108. Exit;
  109. end;
  110. end;
  111.  
  112. function WaitUpTextMulti2(S: TStringArray; Time: Integer): Boolean;
  113. var
  114. T: Integer;
  115. begin
  116. Result := false;
  117. T := GetSystemTime + Time;
  118. while (GetSystemTime < T) do
  119. begin
  120. if (IsUpTextMultiCustom2(S)) then
  121. begin
  122. Result := True;
  123. Exit;
  124. end;
  125. Wait(20 + Random(20));
  126. end;
  127. end;
  128.  
  129. function OpenWScreen: Boolean;
  130. begin
  131. Result := False;
  132. if WorldScreen then
  133. exit;
  134. if Loggedin then
  135. Exit;
  136. if not WorldScreen then
  137. begin
  138. Mmouse(54, 475, 1, 1);
  139. WaitHumanClick;
  140. ClickMouse2(Mouse_Left);
  141. waithumanclick;
  142. Result := True;
  143. end;
  144. end;
  145.  
  146. function whitecolor: boolean;
  147. var
  148. Monster: TpointArray;
  149. TmpCts: Integer;
  150. begin
  151. tmpcts := GetColorToleranceSpeed;
  152. ColorToleranceSpeed(2);
  153. SetColorSpeed2Modifiers(0.22, 1.69);
  154. result := FindColorsTolerance(Monster, 9163999, 192, 67, 583, 469, 4);
  155. ColorToleranceSpeed(tmpcts);
  156. SetColorSpeed2Modifiers(0.2, 0.2);
  157. end;
  158.  
  159. procedure GraboriginalExp;
  160. begin
  161. writeln('we started the script loggedin.. Grabbing original exp for progress report!');
  162. Att1 := R_GetSkillExp(SKILL_ATTACK);
  163. Def1 := R_GetSkillExp(SKILL_DEFENCE);
  164. Str1 := R_GetSkillExp(SKILL_STRENGTH);
  165. Hp1 := R_GetSkillExp(SKILL_HITPOINTS);
  166. end;
  167.  
  168. procedure ProgressReport;
  169. var
  170. timegone,Att2,Def2,Str2,Hp2,HpPerHour,DefPH,AttPh,StrPh:integer;
  171. begin
  172. if (not (loggedin)) then
  173. exit;
  174. ClearDebug;
  175. timegone := (GetTimeRunning/1000);
  176. Att2 := (R_GetSkillExp(SKILL_ATTACK) - Att1);
  177. Def2 := (R_GetSkillExp(SKILL_DEFENCE) - Def1);
  178. Str2 := (R_GetSkillExp(SKILL_STRENGTH) - str1);
  179. Hp2 := (R_GetSkillExp(SKILL_HITPOINTS) - Hp1);
  180. HpPerHour := (3600*(Hp2))/((timegone));
  181. AttPh := (3600*(Att2))/((timegone));
  182. StrPh := (3600*(STr2))/((timegone));
  183. DefPh := (3600*(Def2))/((timegone));
  184. WriteLn('* NMZ');
  185. WriteLn('* Runtime: ' + TimeRunning);
  186. Writeln('*');
  187. writeln('* Att EXP Gained: ' + IntToStr(Att2) + ' Att Exp P/H: ' + IntToStr(Attph));
  188. writeln('* Str ExP Gained: ' + IntToStr(Str2) + ' str Exp P/H: ' + IntToStr(StrPh));
  189. writeln('* Def ExP Gained: ' + IntToStr(Def2) + ' Def Exp P/H: ' + IntToStr(DefPh));
  190. writeln('* Hp ExP Gained: ' + IntToStr(Hp2) + ' Hp Exp P/H: ' + IntToStr(Hp2));
  191. end;
  192.  
  193.  
  194.  
  195. procedure loginloop;
  196. begin
  197. OpenWorldScreen;
  198. repeat
  199. if whitecolor then
  200. break;
  201. if whitecolor then
  202. writeln('yeaya');
  203. if not whitecolor then
  204. writeln('yea22ya');
  205. case random(10) of
  206. 0..2: mouse(randomrange(397, 554), randomrange(78, 394), 1, 1, mouse_move);
  207. 3..4: mouse(randomrange(298, 462), randomrange(200, 392), 1, 1, mouse_move);
  208. 5..6: mouse(randomrange(205, 555), randomrange(80, 154), 1, 1, mouse_move);
  209. 7..10: mouse(randomrange(211, 555), randomrange(246, 367), 1, 1, mouse_move);
  210. end;
  211. until (whitecolor) if whitecolor then
  212. begin
  213. clickmouse2(mouse_left);
  214. waithumanclick;
  215. currentworld;
  216. waithumanclick;
  217. if (CurrentWorldLS = 365) then
  218. exit;
  219. waithumanclick;
  220. loginplayer;
  221. MakeCompass('n');
  222. setangle(0);
  223. exit;
  224. end;
  225. end;
  226.  
  227.  
  228.  
  229.  
  230. function HpLevel: integer;
  231. var
  232. s: string;
  233. CurrentHpLevel: integer;
  234. begin
  235. s := GetTextAtExWrap(520, 50, 540, 70, 0, 5, 1, 65280, 0, statchars07);
  236. CurrentHpLevel := StrToIntDef(GetNumbers(s), - 1);
  237. if (CurrentHpLevel > 0) then
  238. begin
  239. result := CurrentHpLevel
  240. end;
  241. end;
  242.  
  243. function PrayerLevel: integer;
  244. var
  245. s: string;
  246. CurrentHpLevel: integer;
  247. begin
  248. s := GetTextAtExWrap(520, 90, 540, 115, 0, 5, 1, 65280, 0, statchars07);
  249. CurrentHpLevel := StrToIntDef(GetNumbers(s), - 1);
  250. if (CurrentHpLevel > 0) then
  251. begin
  252. result := CurrentHpLevel
  253. end;
  254. end;
  255.  
  256. function AbsorPoints: integer;
  257. var
  258. s: string;
  259. CurrentHpLevel: integer;
  260. begin
  261. s := GetTextAtExWrap(20, 35, 60, 60, 0, 5, 1, 16777215, 0, NMZ);
  262. CurrentHpLevel := StrToIntDef(GetNumbers(s), - 1);
  263. if (CurrentHpLevel > 0) then
  264. begin
  265. result := CurrentHpLevel
  266. end;
  267. end;
  268.  
  269.  
  270.  
  271. 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;
  272. var
  273. III, i, tmpcts: integer;
  274. TPA: tpointarray;
  275. TPAA: T2DPointArray;
  276. begin
  277. if (not (loggedin)) then
  278. exit;
  279. gametab(tab_inv);
  280. tmpcts := GetColorToleranceSpeed;
  281. ColorToleranceSpeed(CTS);
  282. SetColorSpeed2Modifiers(hMoD, SMoD);
  283. FindColorsSpiralTolerance(MSCX, MSCY, TPA, color[III], x, y, xs, ys, Tol) ColorToleranceSpeed(tmpCTS);
  284. SetColorSpeed2Modifiers(0.2, 0.2);
  285. SplitTPAWrap(TPA, split, TPAA);
  286. SortATPAFromSize(TPAA, sort, true);
  287. for I := 0 to High(TPAA) do
  288. begin
  289. MiddleTPAEx(TPAA[i], X, Y);
  290. MMouse(x, y, RandomRange( - 3, 3), RandomRange( - 3, 3));
  291. if WaitUpTextMulti2(uptext, WaitUptextWait + random(WaitUptextRandom)) then
  292. begin
  293. Result := True;
  294. break;
  295. end;
  296. break;
  297. end;
  298. end;
  299.  
  300. function InsideCave: boolean;
  301. var
  302. TPA: TpointArray;
  303. begin
  304. if (not (loggedin)) then
  305. exit;
  306. FindColorsTolerance(TPA, 0, MMX1, MMY1, MMX2, MMY2, 0);
  307. if (Length(TPA) > 0) then
  308. begin
  309. result := true;
  310. end;
  311. end;
  312.  
  313. procedure clickoverload;
  314. begin
  315. if not loggedin then
  316. exit;
  317. if not insidecave then
  318. exit;
  319.  
  320. writeln('we are here1');
  321. gametab(tab_inv);
  322. if FindObject([921106], 1, 2, 0.00, 3.41, 1, 1, ['Drink', 'rink', 'verload', 'Overload'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
  323. clickmouse2(mouse_left);
  324. wait(randomrange(5000, 10000));
  325. end;
  326.  
  327. procedure clickAbsorp;
  328. begin
  329. if not loggedin then
  330. exit;
  331. if not insidecave then
  332. exit;
  333. gametab(tab_inv);
  334. if FindObject([11248528], 15, 2, 0.05, 0.27, 1, 1, ['Drink', 'rink', 'Absoprtion', 'bsorption'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
  335. clickmouse2(mouse_left);
  336. if FindObject([11248528], 15, 2, 0.05, 0.27, 1, 1, ['Drink', 'rink', 'Absoprtion', 'bsorption'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
  337. clickmouse2(mouse_left);
  338. if FindObject([11248528], 15, 2, 0.05, 0.27, 1, 1, ['Drink', 'rink', 'Absoprtion', 'bsorption'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
  339. clickmouse2(mouse_left);
  340. end;
  341.  
  342. function Ispraying: Boolean;
  343. var
  344. overhead: tpointarray;
  345. begin
  346. if (not (loggedin)) then
  347. exit;
  348. result := (FindColorsTolerance(Overhead, 63226, MSX1, MSY1, MSX2, MSY2, 10) or FindColorsTolerance(Overhead, 621348, MSX1, MSY1, MSX2, MSY2, 10))
  349. end;
  350.  
  351.  
  352. function Clickobject(Objpoint: tpoint; Uptext: TStringArray; MaxDistance,RunOffSetX,RunOffsetY:integer): Boolean;
  353. var
  354. Bp, Booth: TPoint;
  355. begin
  356. if (not LoggedIn) then
  357. Exit;
  358. if R_DistanceFromTile(Objpoint) > MaxDistance then
  359. begin
  360. Bp.x := Objpoint.x + RunOffsetX;
  361. Bp.Y := Objpoint.y - RunOffsetY;
  362. R_WalkPath([Bp]);
  363. waithumanclick2;
  364. end;
  365. if R_DistanceFromTile(Objpoint) < 5 then
  366. begin
  367. Booth := R_TileToMS(ObjPoint);
  368. MMouse(Booth.X, Booth.Y, 2, 2);
  369. Sleep(100 + Random(100));
  370. if (R_IsUpTextMulti(Uptext)) then
  371. begin
  372. result := true;
  373. end;
  374. end;
  375. end;
  376.  
  377. function MMouseObject(Objpoint: tpoint; Uptext: TStringArray): Boolean;
  378. var
  379. Booth: TPoint;
  380. begin
  381. if (not LoggedIn) then
  382. Exit;
  383. Booth := R_TileToMS(ObjPoint);
  384. MMouse(Booth.X, Booth.Y, 2, 2);
  385. Sleep(100 + Random(100));
  386. if (R_IsUpTextMulti(Uptext)) then
  387. begin
  388. result := true;
  389. end;
  390. end;
  391.  
  392. function LocateNPC(Name, Uptext: string): boolean;
  393. var
  394. Bp, Tp: Tpoint;
  395. NpcName: tnpc;
  396. begin
  397. if R_FindNpc(Name, NpcName) then
  398. begin
  399. if NpcName.InCombat then
  400. exit;
  401. Tp := NpcName.Tile;
  402. if R_DistanceFromTile(Tp) > 3 then
  403. begin
  404. Bp.x := Tp.x + 1;
  405. Bp.Y := Tp.y - 1;
  406. R_WalkPath([Bp]);
  407. waithumanclick2;
  408. end;
  409. if R_DistanceFromTile(tp) < 5 then
  410. begin
  411. Tp := R_TileToMs(Tp);
  412. Mmouse(Tp.x, Tp.y, 0, 0);
  413. if R_WaitUptext(Uptext, 200) then
  414. begin
  415. result := true;
  416. end;
  417. end;
  418. end;
  419. end;
  420.  
  421.  
  422.  
  423. function ShopScreenS: Boolean;
  424. begin
  425. if not loggedin then exit;
  426. Result := (FindTextTPA(2070783, 10, 22, 30, 476, 52, 'Store', 'UpChars07', Nothing) or (GetColor(482, 36) = 65536));
  427. end;
  428.  
  429. function PointCount(): integer;
  430. var
  431. s: string;
  432. Points: integer;
  433. begin
  434. if not loggedin then
  435. exit;
  436. if not shopscreens then
  437. exit;
  438. wait(randomrange(200, 400));
  439. s := GetTextAtExWrap(327, 55, 450, 82, 0, 5, 1, 2070783, 0, SmallChars07);
  440. Points := StrToIntDef(GetNumbers(s), - 1);
  441. if (Points > 0) then
  442. begin
  443. points := result;
  444. end;
  445. end;
  446.  
  447. function Absorbed: boolean;
  448. begin
  449. if not loggedin then
  450. exit;
  451. if not insidecave then
  452. exit;
  453. result := FindTextTPAMulti(2070783, 0, MSX1, MSY1, MSX2, MSY2, ['Absorption'], StatChars07, nothing);
  454. end;
  455.  
  456.  
  457. procedure clickCoffer;
  458. begin
  459. if not loggedin then exit;
  460. if Clickobject(point(2607, 3114), ['Unlock'],4,1,-1) then
  461. begin
  462. writeln('clicking coffer');
  463. FindALlrandoms;
  464. waithumanclick;
  465. clickmouse2(mouse_left);
  466. waithumanclick2;
  467. if pinscreen then
  468. begin
  469. InPin(bankpin);
  470. end;
  471. end;
  472. end;
  473.  
  474. procedure outsideloop;
  475. begin
  476. if not loggedin then
  477. exit;
  478. FindALlrandoms;
  479. MakeCompass('n');
  480. SetAngle(0);
  481. writeln('we are outside NMZ...');
  482.  
  483. clickCoffer;
  484. writeln('going for vial..');
  485.  
  486.  
  487. if Clickobject(point(2605, 3117), ['Empty'],4,0,-1) then
  488. begin
  489. writeln(' Vial is empty');
  490. MakeCompass('n');
  491. SetAngle(0);
  492. writeln('going for chest to buy potions');
  493. if Clickobject(point(2609, 3119), ['chest'],4,-1,-2) then
  494. begin
  495. writeln(' clicking chest');
  496. FindALlrandoms;
  497. waithumanclick;
  498. clickmouse2(mouse_left);
  499. waithumanclick2;
  500. if pinscreen then
  501. begin
  502. writeln(' entering pin');
  503. InPin(bankpin);
  504. end;
  505. waithumanclick2;
  506. if ShopScreenS then
  507. begin
  508. mouse(250, 70, 3, 3, mouse_left);
  509. WaitHumanClick;
  510. mouse(185, 185, 3, 3, mouse_right);
  511. WaitHumanClick;
  512. WaitOptionMulti(['Buy-X'], 500);
  513. WaitHumanClick2;
  514. if FindNPCChatTextMulti(['Enter amount', 'Enter', 'nter', 'amount', 'mount'], nothing) then
  515. TypeSendEx(Overloads, true);
  516. waithumanclick;
  517. mouse(255, 188, 3, 3, mouse_right);
  518. WaitHumanClick;
  519. WaitOptionMulti(['Buy-X'], 500);
  520. WaitHumanClick2;
  521. if FindNPCChatTextMulti(['Enter amount', 'Enter', 'nter', 'amount', 'mount'], nothing) then
  522. TypeSendEx(Absorbs, true);
  523. if ShopScreens then
  524. mouse(randomrange(486, 487), randomrange(40, 41), 0, 0, mouse_left);
  525. FindALlrandoms;
  526. end;
  527. end;
  528. if (R_InvCount2 <= 28) then
  529. begin
  530. MakeCompass('w');
  531. writeln(' we dont have overloads');
  532. if Clickobject(point(2600, 3116), ['Overload'],4,1,0) then
  533. begin
  534. FindALlrandoms;
  535. writeln(' getting overloads');
  536. if FindObject([921106], 1, 2, 0.00, 3.41, 1, 1, ['Drink', 'rink', 'verload', 'Overload'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
  537. begin
  538. writeln('we have overloads in inv, storing them');
  539. if Clickobject(point(2600, 3116), ['Overload'],4,1,0) then
  540. clickmouse2(mouse_right);
  541. waithumanclick;
  542. WaitOptionMulti(['Store', 'tore'], 3000);
  543. waithumanclick;
  544. if FindNPCChatTextMulti(['please'], clickleft) then
  545. writeln('we clicked yes to store overloads');
  546. waithumanclick2;
  547. end;
  548. if Clickobject(point(2600, 3116), ['Overload'],4,1,0) then
  549. clickmouse2(mouse_right);
  550. WaitOptionMulti(['Take'], 3000);
  551. WaitHumanClick2;
  552. if FindNPCChatTextMulti(['Many', 'any'], move) then
  553. TypeSendEx(Overloads, true);
  554. WaitHumanClick2;
  555. end;
  556. end;
  557. if (R_InvCount2 < 28) then
  558. begin
  559. MakeCompass('w');
  560. writeln(' we dont have absorbs');
  561. if Clickobject(point(2600, 3117), ['Absorption'],4,1,0) then
  562. begin
  563. FindALlrandoms;
  564. writeln(' getting absorb');
  565. MakeCompass('w');
  566. if FindObject([10852996], 20, 2, 0.03, 0.35, 1, 1, ['Drink', 'rink', 'verload', 'Overload'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
  567. begin
  568. writeln('we have absorbs in inv, storing them');
  569. if Clickobject(point(2600, 3117), ['Absorption'],4,1,0) then
  570. clickmouse2(mouse_right);
  571. WaitOptionMulti(['Store', 'tore'], 3000);
  572. WaitHumanClick2;
  573. if FindNPCChatTextMulti(['please'], clickleft) then
  574. writeln('we clicked yes to store absorp');
  575. waithumanclick2;
  576. end;
  577. if Clickobject(point(2600, 3117), ['Absorption'],4,1,0) then
  578. clickmouse2(mouse_right);
  579. WaitOptionMulti(['Take'], 3000);
  580. WaitHumanClick2;
  581. if FindNPCChatTextMulti(['Many', 'any'], move) then
  582. TypeSendEx(Absorbs, true);
  583. WaitHumanClick2;
  584. writeln(' failed to withdraw absorbs');
  585. end;
  586. end;
  587. if LocateNPC('Dominic', 'Dominic') then
  588. begin
  589. FindALlrandoms;
  590. writeln(' finding dominic and starting dream');
  591. waithumanclick;
  592. ClickMouse2(mouse_right);
  593. WaitOptionMulti(['Dream', 'ream'], 500);
  594. waithumanclick2;
  595. if FindTextTPA(ClBlack, 30, MCX1, MCY1, MCX2, MCY2, 'umble', CharsNPC07, Nothing) then
  596. begin
  597. mouse(260, 445, 2, 2, mouse_left);
  598. waithumanclick;
  599. ClickToContinue;
  600. waithumanclick;
  601. mouse(260, 402, 2, 2, mouse_left);
  602. waithumanclick;
  603. ClickToContinue;
  604. end;
  605. end;
  606. end;
  607. if Clickobject(point(2605, 3117), ['Potion'],4,0,-1) then
  608. begin
  609. FindALlrandoms;
  610. writeln(' our dream is ready, starting');
  611. clickmouse2(mouse_left);
  612. waithumanclick2;
  613. if FindObject([4027591], 25, 2, 0.04, 0.79, 1, 1, ['Continue'], 300, 150, 420, 260, 460, 380) then
  614. begin
  615. clickmouse2(mouse_left);
  616. writeln(' waiting 10...10 seconds');
  617. wait(randomrange(6000, 8000));
  618. writeln(' getting our position');
  619. PointInsideCave := R_GetTileGlobal;
  620. writeln(' mapping our 44X44 area');
  621. Cavebottomleft.x := PointInsideCave.x - 44;
  622. Cavebottomleft.y := PointInsideCave.y - 4;
  623. Cavetopleft.x := PointInsideCave.X - 44;
  624. Cavetopleft.y := PointInsideCave.Y + 44;
  625. CaveBottomRight.x := PointInsideCave.X + 44;
  626. CaveBottomRight.y := PointInsideCave.Y - 4;
  627. CavetopRight.x := PointInsideCave.X + 44;
  628. CavetopRight.y := PointInsideCave.y + 44;
  629. end;
  630. end;
  631. end;
  632.  
  633. procedure WaitShortClick;
  634. begin
  635. if (not (loggedin)) then
  636. exit;
  637. case random(600) of
  638. 1..450: Wait(RandomRange(100, 150));
  639. 451..570: Wait(RandomRange(150, 200));
  640. 571..590: Wait(RandomRange(200, 250));
  641. 591..600: Wait(RandomRange(250, 400));
  642. end;
  643. end;
  644.  
  645. procedure WaitShortClick2;
  646. begin
  647. if (not (loggedin)) then
  648. exit;
  649. case random(600) of
  650. 1..450: Wait(RandomRange(400, 450));
  651. 451..570: Wait(RandomRange(450, 500));
  652. 571..590: Wait(RandomRange(500, 550));
  653. 591..600: Wait(RandomRange(550, 600));
  654. end;
  655. end;
  656.  
  657. function HoverNearbyNpc: boolean;
  658. var
  659. I: Tpointarray;
  660. P: Integer;
  661. begin
  662. if (not (loggedin)) then
  663. exit;
  664. I := GetMiniMapDots('npc');
  665. if (length(I) > 0) then
  666. begin
  667. SortTPAFrom(i, Point(MMCX, MMCY));
  668. P := random(length(I)) Mmouse(I[0].x, I[0].y, 3, 3);
  669. result := true;
  670. end;
  671. end;
  672.  
  673. procedure Keyboards;
  674. begin
  675. case random(5) of
  676. 0..2:
  677. begin
  678. KeyDown(37);
  679. WaitShortClick KeyUp(37);
  680. WaitShortClick KeyDown(40);
  681. WaitShortClick KeyUp(40);
  682. end;
  683. 3..4:
  684. begin
  685. KeyDown(39);
  686. WaitShortClick KeyUp(39);
  687. WaitShortClick KeyDown(38);
  688. WaitShortClick KeyUp(38);
  689. end;
  690. 5:
  691. begin
  692. KeyDown(38);
  693. WaitShortClick KeyUp(38);
  694. WaitShortClick KeyDown(39);
  695. WaitShortClick KeyUp(39);
  696. end;
  697. end;
  698. end;
  699.  
  700. procedure Antiban;
  701. begin
  702. if (not (loggedin)) then
  703. exit;
  704. case random(100) of
  705. 0..56:
  706. begin
  707. end;
  708. 57..100:
  709. begin
  710. case random(150) of
  711. 10: hoverskill(skill_magic, false);
  712. 15: HoverOnlineFriend;
  713. 20: BoredHuman;
  714. 30: MMouseOffClient('top');
  715. 40: MMouseOffClient('left');
  716. 50: MMouseOffClient('right');
  717. 60: MMouseOffClient('bottom');
  718. 70: SmallRandomMouse;
  719. 80: RandomAngle(1);
  720. 90: RandomAngle(2);
  721. 100: PickUpMouse;
  722. 110: CompassMovement(10, 70, true);
  723. 120: HoverNearbyNpc;
  724. 130: Keyboards;
  725. 140: MissMouse(250, 250);
  726. 150: RandomMovement;
  727. 160: CompassMovement(240, 300, true);
  728. 170: AdjustMouseSpeed(3, 10, 20);
  729. 180: RandomFKeys(true);
  730. 190: RandomTab(true);
  731. end;
  732. end;
  733. end;
  734. end;
  735.  
  736. procedure idle;
  737. var
  738. HpBarOutside, t: integer;
  739. begin
  740. writeln('entered idle mode..');
  741. marktime(t);
  742. HpBarOutside := randomrange(8000, 10000);
  743. repeat
  744. wait(400);
  745. if not InsideCave then
  746. exit;
  747. if not loggedin then
  748. exit;
  749. if R_InFight then
  750. exit;
  751. until (TimeFromMark(T) >= HpBarOutside) if (TimeFromMark(T) >= HpBarOutside) then
  752. begin
  753. writeln('we entered idling methhod, spinning camera and shit');
  754. antiban;
  755. end;
  756. end;
  757.  
  758. procedure InsideCaveloop;
  759. var
  760. MeInCave, myposinsidecave: tpoint;
  761. begin
  762. if not loggedin then
  763. exit;
  764. if not InsideCave then
  765. exit;
  766. writeln('we are inside cave!');
  767. if R_inPolygon([CavetopRight, CaveBottomRight, Cavebottomleft, Cavetopleft]) then
  768. begin
  769. writeln(' our area mapped correctly, to 44x44 (i know its 40x40)');
  770. MeInCave := R_GetTileGlobal;
  771. writeln(meincave);
  772. if not (MeInCave.x = PointInsideCave.x + 4) then
  773. begin
  774. myposinsidecave.x := PointInsideCave.x + 5;
  775. myposinsidecave.y := PointInsideCave.y - 1;
  776. writeln(myposinsidecave) writeln(PointInsideCave);
  777. FindALlrandoms;
  778. WaitHumanClick2;
  779. FindALlrandoms;
  780. MeInCave := R_GetTileGlobal;
  781. r_walkpath([myposinsidecave]);
  782. waithumanclick2;
  783. MeInCave := R_GetTileGlobal;
  784. writeln(meincave);
  785. if (MeInCave.x = PointInsideCave.x + 4) then
  786. begin
  787. writeln('we got ot the good juciyt spot!');
  788. repeat
  789. WaitHumanClick;
  790. if not loggedin then
  791. exit;
  792. if not InsideCave then
  793. exit;
  794. progressreport;
  795. FindALlrandoms;
  796. if (HpLevel >= 49) then
  797. clickoverload;
  798. if (not Absorbed) then
  799. begin
  800. writeln('we dont have absorb colors clicking absorb!');
  801. ClickAbsorp;
  802. waithumanclick;
  803. ClickAbsorp;
  804. waithumanclick;
  805. end;
  806. if (AbsorPoints <= randomrange(500, 700)) then
  807. clickAbsorp;
  808. if not R_InFight then
  809. idle;
  810. until (not InsideCave);
  811. end;
  812. end;
  813. end
  814. else
  815. begin
  816. writeln('we have started the script while inside the cave, taking our current position as Safe spot/default area as the cave parts');
  817. repeat
  818. WaitHumanClick;
  819. if not loggedin then
  820. exit;
  821. if not InsideCave then
  822. exit;
  823. progressreport;
  824. FindALlrandoms;
  825. if (HpLevel >= 49) then
  826. clickoverload;
  827. if (not Absorbed) then
  828. begin
  829. writeln('we dont have absorb colors clicking absorb!');
  830. ClickAbsorp;
  831. waithumanclick;
  832. ClickAbsorp;
  833. waithumanclick;
  834. ClickAbsorp;
  835. waithumanclick;
  836. ClickAbsorp;
  837. waithumanclick;
  838. end;
  839. if (AbsorPoints <= randomrange(500, 700)) then
  840. clickAbsorp;
  841. if not R_InFight then
  842. idle;
  843. until (not InsideCave);
  844. if not InsideCave then
  845. exit;
  846. if not loggedin then
  847. exit;
  848. end;
  849. end;
  850.  
  851. procedure Termination(const Status: string);
  852. begin
  853. if (TermCheck = false) then
  854. exit;
  855. writeln(Status);
  856. if loggedin then
  857. begin
  858. if WaitFunc(@ LogOut, 500, RandomRange(8000, 20000)) then
  859. terminatescript
  860. else
  861. terminatescript;
  862. end
  863. else
  864. terminatescript;
  865. end;
  866.  
  867. function LogMeOut: boolean;
  868. begin
  869. writeln('Logging out..');
  870. if WaitFunc(@ LogOut, 500, RandomRange(8000, 20000)) then
  871. begin
  872. writeln('We have managed to log out');
  873. result := true;
  874. end
  875. else
  876. termination('We have failed to log out, ending script');
  877. end;
  878.  
  879. procedure mainloop;
  880. var
  881. t: integer;
  882. begin
  883. if not loggedin then
  884. exit;
  885. FindALlrandoms;
  886. if (not InsideCave) and (not R_inPolygon([point(2630, 3122), point(2630, 3110), point(2598, 3110), point(2598, 3122)])) then
  887. begin
  888. writeln('we were lost, ending script');
  889. terminatescript;
  890. end;
  891. if R_inPolygon([point(2620, 3122), point(2620, 3110), point(2598, 3110), point(2598, 3122)]) then
  892. Outsideloop;
  893. if InsideCave then
  894. InsideCaveloop;
  895. if (not InsideCave) and loggedin then
  896. begin
  897. MarkTime(t)
  898. repeat
  899. WaitHumanClick;
  900. if not loggedin then exit;
  901. if insidecave then exit;
  902. FindALlrandoms;
  903. if (R_inPolygon([point(2630, 3122), point(2630, 3110), point(2598, 3110), point(2598, 3122)])) then
  904. exit;
  905. writeln('we are lost.. waiting a bit if still lost then ending script');
  906. until (TimeFromMark(T) < 15000) writeln('we were lost, ending script');
  907. if (timefrommark(t) > 15000) then
  908. begin
  909. if logmeout then
  910. terminatescript;
  911. end;
  912. end;
  913. end;
  914.  
  915. procedure test1;
  916. begin
  917. if FindNPCChatTextMulti([''], move) then
  918. writeln('we did that');
  919. end;
  920.  
  921. begin
  922. playerSetup;
  923. setupsrl;
  924. SetupReflection;
  925. SRL_CombatRandoms := False;
  926. R_CombatRandoms := false;
  927. R_Reincarnate := true;
  928. if loggedin then
  929. graboriginalexp;
  930. if not loggedin then
  931. writeln('we didnt grab original exp, please start the script while you are loggedin');
  932. addonterminate('progressreport');
  933. repeat
  934. if not loggedin then
  935. loginloop;
  936. wait(400);
  937. if loggedin then
  938. mainloop;
  939. until (false);
  940. end.
Advertisement
Add Comment
Please, Sign In to add comment