zamaro

Untitled

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