zamaro

FhouseCurser5

Apr 4th, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.62 KB | None | 0 0
  1. program ScriptSkeleton;
  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.  
  8. var
  9. BankCord, shopcord: tpointarray;
  10. cx, cy, pizzasbought, potatobought, WorldsHopped: integer;
  11. Myloc: tpoint;
  12. Messedup, Failcast, Timer, cast, CaveEntrances: integer;
  13. TimeTillBreak: string;
  14.  
  15. const
  16. CheckWorld = true;
  17. bankpin = '1345';
  18. BuysPizza = false;
  19. BuysPotato = true;
  20. Breakhandler = true;
  21. BreakTime1 = 45;
  22. BreakTime2 = 120;
  23. BreakWait1 = 15;
  24. BreakWait2 = 35;
  25. CorkCol = 3831684;
  26. CorkTol = 16;
  27. CorkCTS = 2;
  28. CorkHue = 0.03;
  29. CorkSat = 0.18;
  30. MainMouseSpeed = 11;
  31.  
  32. procedure playerSetup;
  33. begin
  34. HowManyPlayers := 1;
  35. NumberOfPlayers(HowManyPlayers);
  36. CurrentPlayer := 0;
  37. Players[0].Name := '@gmail.com';
  38. Players[0].Pass := '';
  39. Players[0].Nick := '';
  40. Players[0].Active := True;
  41. end;
  42.  
  43. procedure WaitHumanClick;
  44. begin
  45. case random(600) of
  46. 1..450: Wait(RandomRange(400, 600));
  47. 451..570: Wait(RandomRange(400, 600));
  48. 571..590: Wait(RandomRange(600, 800));
  49. 591..600: Wait(RandomRange(800, 1000));
  50. end;
  51. end;
  52.  
  53. procedure WaitHumanClick2;
  54. begin
  55. case random(600) of
  56. 1..450: Wait(RandomRange(3000, 3500));
  57. 451..570: Wait(RandomRange(3500, 4000));
  58. 571..590: Wait(RandomRange(4000, 4500));
  59. 591..600: Wait(RandomRange(4500, 5000));
  60. end;
  61. end;
  62.  
  63. procedure myvars;
  64. var
  65. ResetLoc: tpoint;
  66. begin
  67. writeln(myloc);
  68. ResetLoc := Point(0, 0);
  69. myloc := ResetLoc;
  70. end;
  71.  
  72. procedure StartTime;
  73. begin
  74. Timer := GetTimeRunning + RandomRange(BreakTime1 * 60000, BreakTime2 * 60000);
  75. end;
  76.  
  77. procedure takebreaks;
  78. var
  79. T, BreakTimer: integer;
  80. Times: string;
  81. begin
  82. if (Breakhandler = false) then
  83. exit;
  84. if (GetTimeRunning >= Timer) then
  85. begin
  86. writeln('its time to take a break....');
  87. BreakTimer := Randomrange(BreakWait1 * 60000, BreakWait2 * 60000);
  88. Times := (MsToTime(BreakTimer, Time_Formal));
  89. writeln('Breaking for: ' + Times);
  90. marktime(t);
  91. repeat
  92. findnormalrandoms;
  93. if srl_infight then
  94. exit;
  95. wait(400);
  96. logout;
  97. until (not (loggedin));
  98. if (not (loggedin)) then
  99. begin
  100. repeat
  101. wait(2000);
  102. until (TimeFromMark(t) >= BreakTimer);
  103. if (TimeFromMark(T) >= BreakTimer) then
  104. begin
  105. writeln('break time is over, back to the script');
  106. StartTime;
  107. myvars;
  108. exit;
  109. end;
  110. end;
  111. end;
  112. end;
  113.  
  114. procedure WaitHumanClick3;
  115. begin
  116. case random(600) of
  117. 1..450: Wait(RandomRange(3000, 5000));
  118. 451..570: Wait(RandomRange(5000, 5500));
  119. 571..590: Wait(RandomRange(6000, 6500));
  120. 591..600: Wait(RandomRange(7000, 7500));
  121. end;
  122. end;
  123.  
  124. function GetGreenUptext: string;
  125. var
  126. WhiteT, BlueT, YellowT, OrangeT, GreenT, FoundText: string;
  127. begin
  128. WhiteT := GetTextAtExWrap(8, 8, 300, 21, 0, 5, 1, 14541281, 55, 'UpChars07');
  129. BlueT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 13423640, 65, 'UpChars07');
  130. YellowT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 1235160, 40, 'UpChars07');
  131. OrangeT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 4687583, 53, 'UpChars07');
  132. GreenT := GetTextAtExWrap(8, 8, 300, 21, 0, 5, 1, 120577, 65, 'UpChars07');
  133. FoundText := WhiteT + ' ' + BlueT + YellowT + OrangeT + GreenT;
  134. FoundText := ReplaceWrap(FoundText, '.', '', [rfReplaceAll]);
  135. FoundText := ReplaceWrap(FoundText, '/', '', [rfReplaceAll]);
  136. FoundText := ReplaceWrap(FoundText, '\', '', [rfReplaceAll]);
  137. FoundText := ReplaceWrap(FoundText, ',', '', [rfReplaceAll]);
  138. FoundText := ReplaceWrap(FoundText, '*', '', [rfReplaceAll]);
  139. FoundText := ReplaceWrap(FoundText, '^', '', [rfReplaceAll]);
  140. FoundText := ReplaceWrap(FoundText, '"', '', [rfReplaceAll]);
  141. Result := FoundText;
  142. end;
  143.  
  144. function IsUpTextMultiCustom2(Text: TStringArray): Boolean;
  145. var
  146. TheText: string;
  147. i, n: Integer;
  148. begin
  149. TheText := GetGreenUptext;
  150. n := High(Text);
  151. for i := 0 to n do
  152. if (Pos(Text[i], TheText) > 0) then
  153. begin
  154. Result := True;
  155. Exit;
  156. end;
  157. end;
  158.  
  159. procedure Hi;
  160. begin
  161. writeln('hi!');
  162. end;
  163.  
  164. function WaitUpTextMulti2(S: TStringArray; Time: Integer): Boolean;
  165. var
  166. T: Integer;
  167. begin
  168. Result := false;
  169. T := GetSystemTime + Time;
  170. while (GetSystemTime < T) do
  171. begin
  172. if (IsUpTextMultiCustom2(S)) then
  173. begin
  174. Result := True;
  175. Exit;
  176. end;
  177. Wait(20 + Random(20));
  178. end;
  179. end;
  180.  
  181. function OpenWScreen: Boolean;
  182. begin
  183. Result := False;
  184. if WorldScreen then
  185. exit;
  186. if Loggedin then
  187. Exit;
  188. if not WorldScreen then
  189. begin
  190. Mmouse(54, 475, 1, 1);
  191. WaitHumanClick;
  192. ClickMouse2(Mouse_Left);
  193. waithumanclick;
  194. Result := True;
  195. end;
  196. end;
  197.  
  198. function whitecolor: boolean;
  199. var
  200. Monster: TpointArray;
  201. TmpCts: Integer;
  202. begin
  203. tmpcts := GetColorToleranceSpeed;
  204. ColorToleranceSpeed(2);
  205. SetColorSpeed2Modifiers(0.22, 1.69);
  206. result := FindColorsTolerance(Monster, 9163999, 192, 67, 583, 469, 4);
  207. ColorToleranceSpeed(tmpcts);
  208. SetColorSpeed2Modifiers(0.2, 0.2);
  209. end;
  210.  
  211. procedure ProgressReport;
  212. var
  213. Timeleft, XpPerhour, Casts, CastsPH: Integer;
  214. begin
  215. if (not (loggedin)) then
  216. exit;
  217. ClearDebug;
  218. XpPerhour := (3600 * (Cast) / ((GetTimeRunning / 1000)));
  219. Casts := ((Cast) / (29));
  220. CastsPH := (3600 * (Casts) / ((GetTimeRunning / 1000)));
  221. timeleft := ((Timer) - (GetTimeRunning));
  222. TimeTillBreak := (MsToTime(timeleft, Time_Formal));
  223. WriteLn('* HouseCurser v.1.0');
  224. WriteLn('* Runtime: ' + TimeRunning);
  225. Writeln('*');
  226. writeln('* Experience Gained: ' + IntToStr(Cast) + ' Exp P/H: ' + IntToStr(XpPerhour));
  227. writeln('* Curse Used : ' + IntToStr(Casts) + ' Casts P/h: ' + IntTostr(CastsPH));
  228. Writeln('* No. Of Times : ' + 'Failed Casting: ' + intTostr(failcast) + ' Messed up: ' + inttostr(messedup) + ' Entered Cave: ' + IntToStr(CaveEntrances));
  229. Writeln('* Time till break : ' + (TimeTillBreak));
  230. Writeln('* Post all Bugs/proggies/errors on this topic: http://villavu.com/forum/showthread.php?t=103236');
  231. end;
  232.  
  233. function FindObjExX(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; Tol, CTS: integer; Hue, Sat: Extended; Step, xs, ys, xe, ye: Integer): Boolean;
  234. var
  235. MidX, MidY, i, j, k, x, y, width, height, HalfWidth, HalfHeight: Integer;
  236. ColorFound: Boolean;
  237. SearchBoxes: array of array of TBox;
  238. p: TPointArray;
  239. begin
  240. if (not (loggedin)) then
  241. exit;
  242. Result := False;
  243. for i := 0 to (GetArrayLength(Color) - 1) do
  244. begin
  245. ColorToleranceSpeed(CTS);
  246. SetColorSpeed2Modifiers(Hue, sat);
  247. if (FindColorSpiralTolerance(cx, cy, Color[i], xs, ys, xe, ye, Tol)) then
  248. begin
  249. ColorToleranceSpeed(1);
  250. SetColorSpeed2Modifiers(0.2, 0.2);
  251. ColorFound := True;
  252. Break;
  253. end;
  254. end;
  255. ColorToleranceSpeed(1);
  256. SetColorSpeed2Modifiers(0.2, 0.2);
  257. if not (ColorFound) then
  258. Exit;
  259. MidX := Round((xe - xs) / 2);
  260. MidY := Round((ye - ys) / 2);
  261. Width := Ceil(abs(xe - xs) / 2 / Step - 0.5) * 2 + 1;
  262. Height := Ceil(abs(ye - ys) / 2 / Step - 0.5) * 2 + 1;
  263. SetLength(SearchBoxes, Width);
  264. HalfWidth := Floor(Width / 2);
  265. HalfHeight := Floor(Height / 2) for x := - 1 * HalfWidth to HalfWidth do
  266. begin
  267. SetLength(SearchBoxes[x + HalfWidth], Height);
  268. for y := - 1 * HalfHeight to HalfHeight do
  269. SearchBoxes[x + HalfWidth][y + HalfHeight] := IntToBox(Max(xs, xs + Round(MidX + ((x - 0.5) * Step))), Max(ys, ys + Round(MidY + ((y - 0.5) * Step))), Min(xe, xs + Round(MidX + ((x + 0.5) * Step))), Min(ye, ys + Round(MidY + ((y + 0.5) * Step))));
  270. end;
  271. p := TPAFromBox(IntToBox(0, 0, Width - 1, Height - 1));
  272. SortTPAFrom(p, Point(floor(Width / 2), floor(Height / 2)));
  273. for k := 0 to High(Color) do
  274. for j := 0 to High(p) do
  275. begin
  276. ColorToleranceSpeed(CTS);
  277. SetColorSpeed2Modifiers(Hue, sat);
  278. if (FindColorTolerance(cx, cy, Color[k], SearchBoxes[p[j].x][p[j].y].x1, SearchBoxes[p[j].x][p[j].y].y1, SearchBoxes[p[j].x][p[j].y].x2, SearchBoxes[p[j].x][p[j].y].y2, Tol)) then
  279. begin
  280. ColorToleranceSpeed(1);
  281. SetColorSpeed2Modifiers(0.2, 0.2);
  282. MMouse(cx, cy, 3, 3);
  283. wait(randomrange(200, 300));
  284. if (WaitUptextMulti2(Text, 300)) then
  285. begin
  286. ColorToleranceSpeed(1);
  287. SetColorSpeed2Modifiers(0.2, 0.2);
  288. GetMousePos(cx, cy);
  289. Result := True;
  290. Exit;
  291. end;
  292. end;
  293. ColorToleranceSpeed(1);
  294. SetColorSpeed2Modifiers(0.2, 0.2);
  295. end;
  296. ColorToleranceSpeed(1);
  297. SetColorSpeed2Modifiers(0.2, 0.2);
  298. end;
  299.  
  300. procedure TeleportToHouse;
  301. begin
  302. if not loggedin then
  303. exit;
  304. gametab(tab_magic);
  305. waithumanclick;
  306. MouseBox(610, 305, 624, 313, mouse_left);
  307. wait(randomrange(10000, 15000));
  308. Myloc := R_GetTileGlobal;
  309. end;
  310.  
  311. procedure loginloop;
  312. var
  313. b: integer;
  314. begin
  315. if (Checkworld = true) then
  316. begin
  317. OpenWorldScreen;
  318. repeat
  319. if not worldscreen then
  320. break;
  321. if whitecolor then
  322. break;
  323. if whitecolor then
  324. writeln('yeaya');
  325. if not whitecolor then
  326. writeln('yea22ya');
  327. MouseBox(294, 408, 375, 423, 0);
  328. until (whitecolor) if whitecolor then
  329. begin
  330. writeln('yoo2');
  331. clickmouse2(mouse_left);
  332. waithumanclick2;
  333. B := CurrentWorldLS;
  334. if (B = 337) then
  335. begin
  336. writeln('yoo');
  337. myvars;
  338. loginplayer;
  339. exit;
  340. end;
  341. end;
  342. end
  343. else
  344. begin
  345. myvars;
  346. loginplayer;
  347. waithumanclick;
  348. end;
  349. end;
  350.  
  351. function GetHp(): integer;
  352. var
  353. s: string;
  354. PizzaCount: integer;
  355. begin
  356. wait(randomrange(200, 400));
  357. s := GetTextAtExWrap(160, 60, 200, 82, 0, 5, 1, 65535, 0, statchars07);
  358. PizzaCount := StrToIntDef(GetNumbers(s), - 1);
  359. writeln(PizzaCount);
  360. if (PizzaCount > 0) then
  361. begin
  362. IncEx(pizzasbought, pizzacount);
  363. wait(randomrange(200, 300));
  364. waithumanclick;
  365. end;
  366. end;
  367.  
  368. function FindMiniGame: boolean;
  369. var
  370. x, y: integer;
  371. begin
  372. result := FindSymbol(x, y, 'minigame');
  373. end;
  374.  
  375. function ColorLocate(var Name: string; Color, Tol, CTS: integer; Hue, Sat: Extended; xs, ys, xe, ye: Integer): boolean;
  376. var
  377. Monster: TpointArray;
  378. TmpCts: Integer;
  379. begin
  380. tmpcts := GetColorToleranceSpeed;
  381. ColorToleranceSpeed(cts);
  382. SetColorSpeed2Modifiers(Hue, sat);
  383. result := FindColorsTolerance(Monster, color, xs, ys, xe, ye, Tol);
  384. ColorToleranceSpeed(tmpcts);
  385. SetColorSpeed2Modifiers(0.2, 0.2);
  386. end;
  387.  
  388. 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;
  389. var
  390. III, i, tmpcts: integer;
  391. TPA: tpointarray;
  392. TPAA: T2DPointArray;
  393. begin
  394. if (not (loggedin)) then
  395. exit;
  396. gametab(tab_inv);
  397. tmpcts := GetColorToleranceSpeed;
  398. ColorToleranceSpeed(CTS);
  399. SetColorSpeed2Modifiers(hMoD, SMoD);
  400. FindColorsSpiralTolerance(MSCX, MSCY, TPA, color[III], x, y, xs, ys, Tol) ColorToleranceSpeed(tmpCTS);
  401. SetColorSpeed2Modifiers(0.2, 0.2);
  402. SplitTPAWrap(TPA, split, TPAA);
  403. SortATPAFromSize(TPAA, sort, true);
  404. for I := 0 to High(TPAA) do
  405. begin
  406. MiddleTPAEx(TPAA[i], X, Y);
  407. MMouse(x, y, RandomRange( - 3, 3), RandomRange( - 3, 3));
  408. if WaitUpTextMulti2(uptext, WaitUptextWait + random(WaitUptextRandom)) then
  409. begin
  410. Result := True;
  411. break;
  412. end;
  413. break;
  414. end;
  415. end;
  416.  
  417. function Clickobject(Objpoint: tpoint; Uptext: TStringArray): Boolean;
  418. var
  419. Bp, Booth: TPoint;
  420. begin
  421. if (not LoggedIn) then
  422. Exit;
  423. if (R_DistanceFromTile(Objpoint) > 3) and (R_DistanceFromTile(Objpoint) < 15) then
  424. begin
  425. Bp.x := Objpoint.x + 1;
  426. Bp.Y := Objpoint.y - 1;
  427. R_WalkPath([Bp]);
  428. waithumanclick2;
  429. end;
  430. if R_DistanceFromTile(Objpoint) < 5 then
  431. begin
  432. Booth := R_TileToMS(ObjPoint);
  433. MMouse(Booth.X, Booth.Y, 2, 2);
  434. Sleep(100 + Random(100));
  435. if (R_IsUpTextMulti(Uptext)) then
  436. begin
  437. result := true;
  438. end;
  439. end;
  440. end;
  441.  
  442. function MMouseObject(Objpoint: tpoint; Uptext: TStringArray): Boolean;
  443. var
  444. Booth: TPoint;
  445. begin
  446. if (not LoggedIn) then
  447. Exit;
  448. Booth := R_TileToMS(ObjPoint);
  449. MMouse(Booth.X, Booth.Y, 2, 2);
  450. Sleep(100 + Random(100));
  451. if (R_IsUpTextMulti(Uptext)) then
  452. begin
  453. result := true;
  454. end;
  455. end;
  456.  
  457. function LocateNPC(Name, Uptext: string): boolean;
  458. var
  459. Bp, Tp: Tpoint;
  460. NpcName: tnpc;
  461. begin
  462. if R_FindNpc(Name, NpcName) then
  463. begin
  464. if NpcName.InCombat then
  465. exit;
  466. Tp := NpcName.Tile;
  467. if (R_DistanceFromTile(tp) > 3) and (R_DistanceFromTile(tp) < 15) then
  468. begin
  469. Bp.x := Tp.x + 1;
  470. Bp.Y := Tp.y - 1;
  471. R_WalkPath([Bp]);
  472. waithumanclick2;
  473. end;
  474. if R_DistanceFromTile(tp) < 5 then
  475. begin
  476. Tp := R_TileToMs(Tp);
  477. Mmouse(Tp.x, Tp.y, 0, 0);
  478. if R_WaitUptext(Uptext, 200) then
  479. begin
  480. result := true;
  481. end;
  482. end;
  483. end;
  484. end;
  485.  
  486. procedure domagics;
  487. begin
  488. end;
  489.  
  490. function OnRangeScreen: boolean;
  491. var
  492. CTS: Integer;
  493. TPA: Tpointarray;
  494. begin
  495. if (not (loggedin)) then
  496. exit;
  497. cts := GetColorToleranceSpeed;
  498. ColorToleranceSpeed(2);
  499. SetColorSpeed2Modifiers(0.05, 0.41);
  500. result := FindColorsTolerance(TPA, 5334901, 482, 36, 492, 45, 12);
  501. ColorToleranceSpeed(CTS);
  502. SetColorSpeed2Modifiers(0.02, 0.2);
  503. end;
  504.  
  505. procedure closerangescreen;
  506. begin
  507. if (not (loggedin)) then
  508. exit;
  509. writeln('we are on skill screen, closing');
  510. mousebox(482, 36, 492, 45, 1);
  511. end;
  512.  
  513. function OnskillScreen: boolean;
  514. var
  515. CTS: Integer;
  516. TPA: Tpointarray;
  517. begin
  518. if (not (loggedin)) then
  519. exit;
  520. cts := GetColorToleranceSpeed;
  521. ColorToleranceSpeed(2);
  522. SetColorSpeed2Modifiers(0.02, 1.48);
  523. result := FindColorsTolerance(TPA, 8042720, 480, 5, 513, 35, 4);
  524. ColorToleranceSpeed(CTS);
  525. SetColorSpeed2Modifiers(0.02, 0.2);
  526. end;
  527.  
  528. procedure CloseSkillScreen;
  529. begin
  530. if (not (loggedin)) then
  531. exit;
  532. writeln('we are on skill screen, closing');
  533. mousebox(494, 17, 500, 22, 1);
  534. end;
  535.  
  536. function OnmageTab: boolean;
  537. var
  538. Monster: TpointArray;
  539. TmpCts: Integer;
  540. Melee: Boolean;
  541. begin
  542. if (not (loggedin)) then
  543. exit;
  544. tmpCTS := GetColorToleranceSpeed;
  545. ColorToleranceSpeed(2);
  546. SetColorSpeed2Modifiers(0.06, 0.24);
  547. result := FindColorsTolerance(Monster, 1382991, 730, 170, 754, 195, 11) melee := result;
  548. ColorToleranceSpeed(0);
  549. SetColorSpeed2Modifiers(0.2, 0.2);
  550. end;
  551.  
  552. function OutofRunes: boolean;
  553. begin
  554. if (not (loggedin)) then
  555. exit;
  556. result := FindTextTPA(clBlack, 0, MCX1, MCY1, MCX2, MCY2, 'ody', smallChars07, Nothing);
  557. end;
  558.  
  559. procedure Termination;
  560. begin
  561. if (loggedin) then
  562. begin
  563. Writeln('we ran out of runes, or something really went wrong?, terminating script');
  564. repeat
  565. if (not (loggedin)) then
  566. break;
  567. logout;
  568. waithumanclick;
  569. if (not (loggedin)) then
  570. break;
  571. until (not (loggedin));
  572. if (not (loggedin)) then
  573. begin
  574. terminatescript;
  575. end;
  576. end;
  577. end;
  578.  
  579. function NotchatTabAll: boolean;
  580. var
  581. Monster: TpointArray;
  582. TmpCts: Integer;
  583. begin
  584. if (not (loggedin)) then
  585. exit;
  586. tmpCTS := GetColorToleranceSpeed;
  587. ColorToleranceSpeed(2);
  588. SetColorSpeed2Modifiers(0.10, 0.34);
  589. result := FindColorsTolerance(Monster, 4213586, 6, 482, 60, 497, 11);
  590. ColorToleranceSpeed(0);
  591. SetColorSpeed2Modifiers(0.2, 0.2);
  592. end;
  593.  
  594. procedure MakeMyChatTabAll;
  595. begin
  596. if (not (loggedin)) then
  597. exit;
  598. writeln('Our chat Tab is not set to all, making chat tab to all');
  599. mousebox(12, 485, 45, 497, 1);
  600. end;
  601.  
  602. procedure WaitAfterCast;
  603. begin
  604. if (not (loggedin)) then
  605. exit;
  606. case random(600) of
  607. 1..450: Wait(RandomRange(100, 300));
  608. 451..570: Wait(RandomRange(300, 400));
  609. 571..590: Wait(RandomRange(400, 600));
  610. 591..600: Wait(RandomRange(600, 1000));
  611. end;
  612. end;
  613.  
  614. procedure WaitShortClick;
  615. begin
  616. if (not (loggedin)) then
  617. exit;
  618. case random(600) of
  619. 1..450: Wait(RandomRange(100, 150));
  620. 451..570: Wait(RandomRange(150, 200));
  621. 571..590: Wait(RandomRange(200, 250));
  622. 591..600: Wait(RandomRange(250, 400));
  623. end;
  624. end;
  625.  
  626. procedure WaitShortClick2;
  627. begin
  628. if (not (loggedin)) then
  629. exit;
  630. case random(600) of
  631. 1..450: Wait(RandomRange(400, 450));
  632. 451..570: Wait(RandomRange(450, 500));
  633. 571..590: Wait(RandomRange(500, 550));
  634. 591..600: Wait(RandomRange(550, 600));
  635. end;
  636. end;
  637.  
  638. procedure MouseSpeedz;
  639. begin
  640. if (not (loggedin)) then
  641. exit;
  642. case random(600) of
  643. 1..450: MouseSpeed := MainMouseSpeed;
  644. 451..570: MouseSpeed := MainMouseSpeed + randomrange( - 1, 1);
  645. 571..590: MouseSpeed := MainMouseSpeed + randomrange( - 1, 2);
  646. 591..600: MouseSpeed := MainMouseSpeed + randomrange( - 1, 3);
  647. end;
  648. end;
  649.  
  650. procedure FindIfonMagetab;
  651. begin
  652. if (not (loggedin)) then
  653. exit;
  654. if (not (OnmageTab)) then
  655. begin
  656. gametab(tab_magic);
  657. waitshortclick2;
  658. end
  659. else
  660. begin
  661. if (OnmageTab) then
  662. exit;
  663. end;
  664. end;
  665.  
  666. function HoverNearbyNpc: boolean;
  667. var
  668. I: Tpointarray;
  669. P: Integer;
  670. begin
  671. if (not (loggedin)) then
  672. exit;
  673. I := GetMiniMapDots('npc');
  674. if (length(I) > 0) then
  675. begin
  676. SortTPAFrom(i, Point(MMCX, MMCY));
  677. P := random(length(I)) Mmouse(I[0].x, I[0].y, 3, 3);
  678. result := true;
  679. end;
  680. end;
  681.  
  682. procedure Keyboards;
  683. begin
  684. case random(5) of
  685. 0..2:
  686. begin
  687. KeyDown(37);
  688. WaitShortClick KeyUp(37);
  689. WaitShortClick KeyDown(40);
  690. WaitShortClick KeyUp(40);
  691. end;
  692. 3..4:
  693. begin
  694. KeyDown(39);
  695. WaitShortClick KeyUp(39);
  696. WaitShortClick KeyDown(38);
  697. WaitShortClick KeyUp(38);
  698. end;
  699. 5:
  700. begin
  701. KeyDown(38);
  702. WaitShortClick KeyUp(38);
  703. WaitShortClick KeyDown(39);
  704. WaitShortClick KeyUp(39);
  705. end;
  706. end;
  707. end;
  708.  
  709. procedure Antiban;
  710. begin
  711. if (not (loggedin)) then
  712. exit;
  713. case random(100) of
  714. 0..56:
  715. begin
  716. end;
  717. 57..100:
  718. begin
  719. case random(150) of
  720. 10: hoverskill(skill_magic, false);
  721. 15: HoverOnlineFriend;
  722. 20: BoredHuman;
  723. 30: MMouseOffClient('top');
  724. 40: MMouseOffClient('left');
  725. 50: MMouseOffClient('right');
  726. 60: MMouseOffClient('bottom');
  727. 70: SmallRandomMouse;
  728. 80: RandomAngle(1);
  729. 90: RandomAngle(2);
  730. 100: PickUpMouse;
  731. 110: CompassMovement(10, 70, true);
  732. 120: HoverNearbyNpc;
  733. 130: Keyboards;
  734. 140: MissMouse(250, 250);
  735. 150: RandomMovement;
  736. 160: CompassMovement(240, 300, true);
  737. 170: AdjustMouseSpeed(3, 10, 20);
  738. 180: RandomFKeys(true);
  739. 190: RandomTab(true);
  740. end;
  741. end;
  742. end;
  743. end;
  744.  
  745. function LocateMonster1(Color: TintegerArray; Tol, CTS: integer; hMoD, sMoD: Extended; Uptext: array of string): Boolean;
  746. var
  747. R, ii, X, y, i, tmpcts: integer;
  748. bp, orb: tpoint;
  749. TPA: Tpointarray;
  750. ATPA: T2DPointArray;
  751. Boxm: tbox;
  752. begin
  753. if (not (Loggedin)) then
  754. exit;
  755. orb.x := myloc.x;
  756. orb.y := myloc.y + 8;
  757. if R_DistanceFromTile(oRB) > 15 then
  758. exit;
  759. if (R_DistanceFromTile(oRB) > 3) and (R_DistanceFromTile(oRB) < 15) then
  760. begin
  761. Bp.x := orb.x;
  762. Bp.Y := orb.y - 1;
  763. R_WebWalk(bp);
  764. waithumanclick2;
  765. end;
  766. MouseSpeedz;
  767. FindIfonMagetab;
  768. case random(10) of
  769. 0..7: Mouse(RandomRange(668, 669), RandomRange(263, 264), random(3), random(3), mouse_move);
  770. 8..10: Mouse(RandomRange(663, 670), RandomRange(260, 265), random(1), random(1), mouse_move);
  771. end;
  772. if WaitUpTextMulti2(['Curse'], 300) then
  773. begin
  774. clickmouse2(mouse_left);
  775. waitshortclick;
  776. case random(30) of
  777. 0..27: Clickobject(orb, ['Curse']);
  778. 28..30: FindObjExX(cx, cy, ['Curse'], [7571064], 21, 2, 0.59, 0.07, 50, msx1, msy1, msx2, msy2);
  779. end;
  780. wait(randomrange(90, 120));
  781. if WaitUpTextMulti2(['Curse'], 300) then
  782. begin
  783. clickmouse2(mouse_left);
  784. if Didclick(true, 1000) then
  785. begin
  786. IncEx(cast, 29);
  787. progressreport;
  788. case random(100) of
  789. 1:
  790. begin
  791. case random(100) of
  792. 0..80:
  793. begin
  794. end;
  795. 81..100: Antiban;
  796. end;
  797. case random(50) of
  798. 0..42: waitafterCast;
  799. 43..48: waithumanclick2;
  800. 49..50: Wait(randomrange(15000, 25000));
  801. end;
  802. end;
  803. 2:
  804. begin
  805. end;
  806. end;
  807. result := true;
  808. exit;
  809. end
  810. else
  811. begin
  812. inc(Failcast);
  813. exit;
  814. end;
  815. end
  816. else
  817. begin
  818. inc(failcast);
  819. exit;
  820. end;
  821. end
  822. else
  823. begin
  824. inc(failcast);
  825. exit;
  826. end;
  827. end;
  828.  
  829. procedure Inhouseloop;
  830. var
  831. bp, Orb: tpoint;
  832. begin
  833. writeln('yooo');
  834. MakeCompass('w');
  835. setangle(1);
  836. orb.x := myloc.x;
  837. orb.y := myloc.y + 8;
  838. if (orb.x = 0) then
  839. TeleportToHouse;
  840. if (R_DistanceFromTile(oRB) > 3) and (R_DistanceFromTile(oRB) < 25) then
  841. begin
  842. writeln('yoo2o');
  843. Bp.x := orb.x;
  844. Bp.Y := orb.y - 1;
  845. R_WebWalk(bp);
  846. waithumanclick2;
  847. end;
  848. if Clickobject(orb, ['Activate', 'ctivate']) then
  849. begin
  850. clickmouse2(mouse_left);
  851. waithumanclick2;
  852. end;
  853. waithumanclick2;
  854. if Clickobject(orb, ['Banish', 'anish']) then
  855. begin
  856. repeat
  857. WaitHumanClick;
  858. if not loggedin then
  859. exit;
  860. if R_DistanceFromTile(oRB) > 5 then
  861. exit;
  862. if OnskillScreen then
  863. CloseSkillScreen;
  864. if (onrangescreen) then
  865. closerangescreen;
  866. if OutofRunes then
  867. Termination;
  868. if (NotchatTabAll) then
  869. MakeMyChatTabAll;
  870. takebreaks;
  871. LocateMonster1([7571064], 21, 2, 0.59, 0.07, ['Curse']);
  872. until (not loggedin);
  873. end;
  874. end;
  875.  
  876. procedure mainloop;
  877. begin
  878. if not loggedin then
  879. exit;
  880. if srl_InFight then
  881. TeleportToHouse;
  882. if FindObjExX(cx, cy, ['Activate', 'ctivate', 'Banish', 'anish'], [6982271], 22, 2, 0.30, 0.25, 50, msx1, msy1, msx2, msy2) then
  883. Inhouseloop;
  884. if (not R_inPolygon([point(2957, 3220), point(2957, 3228), point(2950, 3228), point(2950, 3220)]) and FindObjExX(cx, cY, ['Portal'], [5774918], 5, 2, 0.15, 4.50, 50, msx1, msy1, msx2, msy2)) then
  885. begin
  886. writeln('yes');
  887. Inhouseloop;
  888. end;
  889. if R_inPolygon([point(2957, 3220), point(2957, 3228), point(2950, 3228), point(2950, 3220)]) and FindObjExX(cx, cY, ['Enter', 'nter', 'ortal', 'Portal'], [5774918], 5, 2, 0.15, 4.50, 50, msx1, msy1, msx2, msy2) then
  890. begin
  891. writeln('yess');
  892. if FindObject([5774918], 5, 2, 0.15, 4.50, 20, 20, ['Enter', 'nter', 'ortal', 'Portal'], 300, 250, msx1, msy1, msx2, msy2) then
  893. begin
  894. writeln('yess2');
  895. if srl_InFight then
  896. TeleportToHouse;
  897. clickmouse2(mouse_left);
  898. wait(randomrange(2000, 3000));
  899. mousebox(180, 375, 325, 390, mouse_left);
  900. wait(randomrange(10000, 15000));
  901. Myloc := R_GetTileGlobal;
  902. end;
  903. end;
  904. if (not R_inPolygon([point(2957, 3220), point(2957, 3228), point(2950, 3228), point(2950, 3220)])) and not FindObjExX(cx, cY, ['Portal'], [5774918], 5, 2, 0.15, 4.50, 50, msx1, msy1, msx2, msy2) then
  905. begin
  906. writeln('yes2');
  907. if srl_InFight then
  908. TeleportToHouse;
  909. TeleportToHouse;
  910. end;
  911. end;
  912.  
  913. begin
  914. playerSetup;
  915. setupsrl;
  916. SetupReflection;
  917. StartTime;
  918. myvars;
  919. repeat
  920. wait(400);
  921. if not loggedin then
  922. loginloop;
  923. wait(400);
  924. if loggedin then
  925. mainloop;
  926. until (false);
  927. end.
Advertisement
Add Comment
Please, Sign In to add comment