Advertisement
zamaro

Curser with breaks fixed

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