zamaro

HouseCurser

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