zamaro

House Curser

May 30th, 2014
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.73 KB | None | 0 0
  1. {*+++++++++++++*}
  2. {+ Insructions +}
  3. {+ To Hide The Instructions Press the Minus '-' on the first line +}
  4. {+ Be sure to do your setup correctly! +}
  5. {*+++++++++++++*}
  6.  
  7.  
  8. {*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
  9. ================================================================================
  10. A|(InGame-Setup)
  11.  
  12. A1) Brightness to highest | Auto retaliate on.
  13. A2) Bring lots of House teleport runes (not tablet(s)).
  14. A3) Start either outside your house or at a distant spot.
  15. A3.B) If you start inside house, script will just use house to calibrate cords.
  16. A4) Equip the following: Ring of life, Magic staff or Mud battle staff.
  17. A5) Have -65 Mage bonus for your magic attack; Full Metal Armor + Dragon Vambs.
  18. ______________________________________________________________________________
  19. B|(Script-Setup)
  20.  
  21.  
  22. B1) you need the SRL-OSR include, Smart8.3 & reflection.
  23. B2) If smart is already opened, pair it up before you launch the script.
  24. B3) Redefine your player settings to your choice.
  25. B4) If you launched and got an error, paste it at: http://ilya.xxx/ssf/
  26. ________________________________________________________________________________
  27. ================================================================================
  28. {Start of the script}
  29.  
  30.  
  31. program HouseCurser;
  32. {$DEFINE SMART8}
  33. {$I SRL-OSR/SRL.Simba}
  34. {$I SRL-OSR/SRL/Reflection/Reflection.simba}
  35. {$i SRL-OSR\SRL\misc\debug.simba}
  36. {$i SRL-OSR\SRL\misc\SmartGraphics.simba}
  37. {$I F_AntiRandoms.simba}
  38.  
  39. var
  40. cx, cy: integer;
  41. Myloc: tpoint;
  42. SleepTimer, Failcast, Timer, cast: integer;
  43. TimeTillLongBreak,TimeTillBreak: string;
  44.  
  45. const
  46. CheckWorld = true;// Checks if you are on world 337, will change to it if not.
  47. TermCheck = true;// Checks & terminates script on errors.
  48.  
  49. Breakhandler = true; // Enable breaking.
  50. BreakTime1 = 45; // Min time to play before breaking.
  51. BreakTime2 = 100; // max time to play before breaking.
  52. BreakWait1 = 8; // min time to break for,
  53. BreakWait2 = 25; // max time to break for. (random range).
  54.  
  55. SleepBreaks = false; // Sleep breaks, initiates after long hours of gameplay.
  56. SleepBreak1 = 7; // Min timeto play before starting a sleep break.
  57. SleepBreak2 = 14; // Max time to play before starting a sleep breka.
  58. SleepWait1 = 1; // Min time to sleep for ** TIME IN HOURS NOT MINUTES*
  59. SleepWait2 = 3; // Max time to sleep for (random range).
  60.  
  61. MainMouseSpeed = 11; // average mouse speed.
  62.  
  63. procedure playerSetup;
  64. begin
  65. HowManyPlayers := 2;
  66. NumberOfPlayers(HowManyPlayers);
  67. CurrentPlayer := 0;
  68. Players[0].Name := '@'; //username
  69. Players[0].Pass := ''; // password
  70. Players[0].Nick := ''; // nickname (4 letters).
  71. Players[0].Active := True;
  72. end;
  73.  
  74.  
  75. function FindTheRandoms(): boolean;
  76. begin
  77. result := _FindAllrandoms(false,[]);
  78. end;
  79.  
  80. procedure FindALlrandoms;
  81. begin
  82. FindNormalRandoms;
  83. FindTheRandoms;
  84. FindMod;
  85. end;
  86.  
  87.  
  88.  
  89. procedure WaitHumanClick;
  90. begin
  91. case random(600) of
  92. 1..450: Wait(RandomRange(400, 600));
  93. 451..570: Wait(RandomRange(400, 600));
  94. 571..590: Wait(RandomRange(600, 800));
  95. 591..600: Wait(RandomRange(800, 1000));
  96. end;
  97. end;
  98.  
  99. procedure WaitHumanClick2;
  100. begin
  101. case random(600) of
  102. 1..450: Wait(RandomRange(3000, 3500));
  103. 451..570: Wait(RandomRange(3500, 4000));
  104. 571..590: Wait(RandomRange(4000, 4500));
  105. 591..600: Wait(RandomRange(4500, 5000));
  106. end;
  107. end;
  108.  
  109. procedure myvars;
  110. var
  111. ResetLoc: tpoint;
  112. begin
  113. writeln(myloc);
  114. ResetLoc := Point(0, 0);
  115. myloc := ResetLoc;
  116. end;
  117.  
  118. procedure StartTime;
  119. begin
  120. Timer := GetTimeRunning + RandomRange(BreakTime1 * 60000, BreakTime2 * 60000);
  121. end;
  122.  
  123. procedure LongBreakTimer;
  124. begin
  125. SleepTimer := GetTimeRunning + RandomRange(SleepBreak1 * 3600000, SleepBreak2 * 3600000);
  126. end;
  127.  
  128. procedure Termination(const Status: string);
  129. begin
  130. if (TermCheck = false) then // Users can Enable/disable termination checks
  131. exit;
  132. writeln(Status); // Prints our reason for termination
  133. Writeln('Time we ended the script: ' + (thetime));
  134. if loggedin then // if we're logged in, it will log us out.
  135. begin
  136. if WaitFunc(@ LogOut, 500, RandomRange(8000, 20000)) then // waits for the script to log out.
  137. terminatescript
  138. else
  139. terminatescript; // if it doesn't manage to log out, it ends anyway
  140. end else
  141. terminatescript; // and if we're not loggedin it ends.
  142. end;
  143.  
  144. function LogMeOut: boolean;
  145. begin
  146. writeln('Logging out..');
  147. if WaitFunc(@ LogOut, 500, RandomRange(8000, 20000)) then
  148. begin //Logging out is buggy right now on OSRS, it needs some extra time
  149. writeln('We have managed to log out');
  150. result := true;
  151. end else //ends script if we fail to logout
  152. termination('We have failed to log out, ending script');
  153. end;
  154.  
  155.  
  156.  
  157. procedure TakeBreaks;
  158. var
  159. T, BreakTimer, BreakTimer2: integer;
  160. begin
  161. WaitHumanClick;
  162. writeln('1');
  163. if (GetTimeRunning >= SleepTimer) then
  164. begin
  165. LongBreakTimer;
  166. BreakTimer2 := Randomrange(SleepWait1 * 3600000, SleepWait2 * 3600000);
  167. MarkTime(T);
  168. writeln('It is time to take a LONG break');
  169. Writeln('Time we started the break: ' + (thetime));
  170. WriteLn('Breaking for: ' + (MsToTime(BreakTimer2, Time_Formal)));
  171. case random (10) of
  172. 0..6:writeln('not logging');
  173. 7..10: LogMeOut;
  174. end;
  175. repeat
  176. WaitHumanClick;
  177. if (TimeFromMark(t) >= BreakTimer2) then
  178. break;
  179. until (TimeFromMark(T) >= BreakTimer2);
  180. if (TimeFromMark(t) >= BreakTime2) then
  181. begin
  182. writeln('breaking is done.. Back to the script');
  183. LongBreakTimer;
  184. end;
  185. end;
  186. if (GetTimeRunning >= Timer) then
  187. begin
  188. StartTime;
  189. BreakTimer := Randomrange(BreakWait1 * 60000, BreakWait2 * 60000);
  190. writeln('It is time to take a break');
  191. Writeln('Time we started the break: ' + (thetime));
  192. WriteLn('Breaking for: ' + (MsToTime(BreakTimer, Time_Formal)));
  193. MarkTime(t);
  194. writeln('breaking....');
  195. case random (10) of
  196. 0..6:writeln('not logging');
  197. 7..10: LogMeOut;
  198. end;
  199. repeat
  200. WaitHumanClick;
  201. if (TimeFromMark(t) >= BreakTimer) then
  202. break;
  203. until (TimeFromMark(T) >= BreakTimer);
  204. if (TimeFromMark(t) >= BreakTimer) then
  205. begin
  206. writeln('breaking is done.. Back to the script');
  207. StartTime;
  208. end;
  209. end;
  210. end;
  211.  
  212. function GetGreenUptext: string;
  213. var
  214. WhiteT, BlueT, YellowT, OrangeT, GreenT, FoundText: string;
  215. begin
  216. WhiteT := GetTextAtExWrap(8, 8, 300, 21, 0, 5, 1, 14541281, 55, 'UpChars07');
  217. BlueT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 13423640, 65, 'UpChars07');
  218. YellowT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 1235160, 40, 'UpChars07');
  219. OrangeT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 4687583, 53, 'UpChars07');
  220. GreenT := GetTextAtExWrap(8, 8, 300, 21, 0, 5, 1, 120577, 65, 'UpChars07');
  221. FoundText := WhiteT + ' ' + BlueT + YellowT + OrangeT + GreenT;
  222. FoundText := ReplaceWrap(FoundText, '.', '', [rfReplaceAll]);
  223. FoundText := ReplaceWrap(FoundText, '/', '', [rfReplaceAll]);
  224. FoundText := ReplaceWrap(FoundText, '\', '', [rfReplaceAll]);
  225. FoundText := ReplaceWrap(FoundText, ',', '', [rfReplaceAll]);
  226. FoundText := ReplaceWrap(FoundText, '*', '', [rfReplaceAll]);
  227. FoundText := ReplaceWrap(FoundText, '^', '', [rfReplaceAll]);
  228. FoundText := ReplaceWrap(FoundText, '"', '', [rfReplaceAll]);
  229. Result := FoundText;
  230. end;
  231.  
  232. function IsUpTextMultiCustom2(Text: TStringArray): Boolean;
  233. var
  234. TheText: string;
  235. i, n: Integer;
  236. begin
  237. TheText := GetGreenUptext;
  238. n := High(Text);
  239. for i := 0 to n do
  240. if (Pos(Text[i], TheText) > 0) then
  241. begin
  242. Result := True;
  243. Exit;
  244. end;
  245. end;
  246.  
  247.  
  248.  
  249. function WaitUpTextMulti2(S: TStringArray; Time: Integer): Boolean;
  250. var
  251. T: Integer;
  252. begin
  253. Result := false;
  254. T := GetSystemTime + Time;
  255. while (GetSystemTime < T) do
  256. begin
  257. if (IsUpTextMultiCustom2(S)) then
  258. begin
  259. Result := True;
  260. Exit;
  261. end;
  262. Wait(20 + Random(20));
  263. end;
  264. end;
  265.  
  266. function OpenWScreen: Boolean;
  267. begin
  268. Result := False;
  269. if WorldScreen then
  270. exit;
  271. if Loggedin then
  272. Exit;
  273. if not WorldScreen then
  274. begin
  275. Mmouse(54, 475, 1, 1);
  276. WaitHumanClick;
  277. ClickMouse2(Mouse_Left);
  278. waithumanclick;
  279. Result := True;
  280. end;
  281. end;
  282.  
  283. function whitecolor: boolean;
  284. var
  285. Monster: TpointArray;
  286. TmpCts: Integer;
  287. begin
  288. tmpcts := GetColorToleranceSpeed;
  289. ColorToleranceSpeed(2);
  290. SetColorSpeed2Modifiers(0.22, 1.69);
  291. result := FindColorsTolerance(Monster, 9163999, 192, 67, 583, 469, 4);
  292. ColorToleranceSpeed(tmpcts);
  293. SetColorSpeed2Modifiers(0.2, 0.2);
  294. end;
  295.  
  296. function NotOnPvpWorlds: boolean;
  297. var
  298. s: string;
  299. Points: integer;
  300. begin
  301. if not loggedin then
  302. exit;
  303. s := GetTextAtExWrap(465, 275, 510, 301, 0, 5, 1, 2070783, 0, StatChars07);
  304. Points := StrToIntDef(GetNumbers(s), - 1);
  305. if (Points < 107) then
  306. begin
  307. result := true;
  308. end;
  309. end;
  310.  
  311. procedure ProgressReport;
  312. var
  313. CurseLeft,mage1,Total,Timeleft,timeleft2, XpPerhour, Casts, CastsPH: Integer;
  314. begin
  315. if (not (loggedin)) then
  316. exit;
  317. ClearDebug;
  318. XpPerhour := (3600 * (Cast) / ((GetTimeRunning / 1000)));
  319. Casts := ((Cast) / (29));
  320. CastsPH := (3600 * (Casts) / ((GetTimeRunning / 1000)));
  321. timeleft := ((Timer) - (GetTimeRunning));
  322. timeleft2 := ((SleepTimer) - (GetTimeRunning));
  323. TimeTillBreak := (MsToTime(timeleft, Time_Formal));
  324. TimeTillLongBreak := (MsToTime(timeleft2, Time_Formal));
  325. mage1 := ((7944614) - (R_GetSkillExp(SKill_magic)));
  326. if (timeleft) < 0 then
  327. StartTime;
  328. if (timeleft2) < 0 then
  329. LongBreakTimer;
  330. CurseLeft := ((mage1) / 29);
  331. if (XpPerhour <> 0) then
  332. Total := ((CurseLeft) / Castsph);
  333. WriteLn('* HouseCurser v.1.0');
  334. WriteLn('* Runtime: ' + TimeRunning);
  335. Writeln('*');
  336. writeln('* Experience Gained: ' + IntToStr(Cast) + ' Exp P/H: ' + IntToStr(XpPerhour));
  337. writeln('* Curse Used : ' + IntToStr(Casts) + ' Casts P/h: ' + IntTostr(CastsPH));
  338. Writeln('* No. Of Times : ' + 'Failed Casting: ' + intTostr(failcast));
  339. Writeln('* Time to 94 mage : ' + IntToSTr(Total) + ' Hours' + ' Total Casts left: ' + IntToSTr(CurseLeft));
  340. Writeln('* Time till break : ' + (TimeTillBreak));
  341. Writeln('* Time till LONG break : ' + (TimeTillLongBreak));
  342. end;
  343.  
  344. function FindObjExX(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; Tol, CTS: integer; Hue, Sat: Extended; Step, xs, ys, xe, ye: Integer): Boolean;
  345. var
  346. MidX, MidY, i, j, k, x, y, width, height, HalfWidth, HalfHeight: Integer;
  347. ColorFound: Boolean;
  348. SearchBoxes: array of array of TBox;
  349. p: TPointArray;
  350. begin
  351. if (not (loggedin)) then
  352. exit;
  353. Result := False;
  354. for i := 0 to (GetArrayLength(Color) - 1) do
  355. begin
  356. ColorToleranceSpeed(CTS);
  357. SetColorSpeed2Modifiers(Hue, sat);
  358. if (FindColorSpiralTolerance(cx, cy, Color[i], xs, ys, xe, ye, Tol)) then
  359. begin
  360. ColorToleranceSpeed(1);
  361. SetColorSpeed2Modifiers(0.2, 0.2);
  362. ColorFound := True;
  363. Break;
  364. end;
  365. end;
  366. ColorToleranceSpeed(1);
  367. SetColorSpeed2Modifiers(0.2, 0.2);
  368. if not (ColorFound) then
  369. Exit;
  370. MidX := Round((xe - xs) / 2);
  371. MidY := Round((ye - ys) / 2);
  372. Width := Ceil(abs(xe - xs) / 2 / Step - 0.5) * 2 + 1;
  373. Height := Ceil(abs(ye - ys) / 2 / Step - 0.5) * 2 + 1;
  374. SetLength(SearchBoxes, Width);
  375. HalfWidth := Floor(Width / 2);
  376. HalfHeight := Floor(Height / 2) for x := - 1 * HalfWidth to HalfWidth do
  377. begin
  378. SetLength(SearchBoxes[x + HalfWidth], Height);
  379. for y := - 1 * HalfHeight to HalfHeight do
  380. 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))));
  381. end;
  382. p := TPAFromBox(IntToBox(0, 0, Width - 1, Height - 1));
  383. SortTPAFrom(p, Point(floor(Width / 2), floor(Height / 2)));
  384. for k := 0 to High(Color) do
  385. for j := 0 to High(p) do
  386. begin
  387. ColorToleranceSpeed(CTS);
  388. SetColorSpeed2Modifiers(Hue, sat);
  389. 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
  390. begin
  391. ColorToleranceSpeed(1);
  392. SetColorSpeed2Modifiers(0.2, 0.2);
  393. MMouse(cx, cy, 3, 3);
  394. wait(randomrange(200, 300));
  395. if (WaitUptextMulti2(Text, 300)) then
  396. begin
  397. ColorToleranceSpeed(1);
  398. SetColorSpeed2Modifiers(0.2, 0.2);
  399. GetMousePos(cx, cy);
  400. Result := True;
  401. Exit;
  402. end;
  403. end;
  404. ColorToleranceSpeed(1);
  405. SetColorSpeed2Modifiers(0.2, 0.2);
  406. end;
  407. ColorToleranceSpeed(1);
  408. SetColorSpeed2Modifiers(0.2, 0.2);
  409. end;
  410.  
  411. procedure TeleportToHouse;
  412. begin
  413. if not loggedin then
  414. exit;
  415. gametab(tab_magic);
  416. waithumanclick;
  417. MouseBox(610, 305, 624, 313, mouse_move);
  418. WaitHumanClick;
  419. if WaitUpTextMulti2(['House'],300) then
  420. ClickMouse2(mouse_left)
  421. else Termination('We couldnt find the house teleport uptext, ending');
  422. wait(randomrange(6000, 15000));
  423. Myloc := R_GetTileGlobal;
  424. end;
  425.  
  426. procedure loginloop;
  427. var
  428. b: integer;
  429. begin
  430. if (CurrentWorldLS = 325) then
  431. begin
  432. loginplayer;
  433. exit;
  434. end;
  435. if (Checkworld = true) then
  436. begin
  437. OpenWorldScreen;
  438. repeat
  439. if not worldscreen then
  440. break;
  441. if whitecolor then
  442. break;
  443. MouseBox(294, 408, 375, 423, 0);
  444. until (whitecolor) if whitecolor then
  445. begin
  446. clickmouse2(mouse_left);
  447. waithumanclick2;
  448. B := CurrentWorldLS;
  449. if (B = 325) then
  450. begin
  451.  
  452. myvars;
  453. loginplayer;
  454. exit;
  455. end;
  456. end;
  457. end
  458. else
  459. begin
  460. myvars;
  461. loginplayer;
  462. waithumanclick;
  463. end;
  464. end;
  465.  
  466. function ColorLocate(var Name: string; Color, Tol, CTS: integer; Hue, Sat: Extended; xs, ys, xe, ye: Integer): boolean;
  467. var
  468. Monster: TpointArray;
  469. TmpCts: Integer;
  470. begin
  471. tmpcts := GetColorToleranceSpeed;
  472. ColorToleranceSpeed(cts);
  473. SetColorSpeed2Modifiers(Hue, sat);
  474. result := FindColorsTolerance(Monster, color, xs, ys, xe, ye, Tol);
  475. ColorToleranceSpeed(tmpcts);
  476. SetColorSpeed2Modifiers(0.2, 0.2);
  477. end;
  478.  
  479. 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;
  480. var
  481. III, i, tmpcts: integer;
  482. TPA: tpointarray;
  483. TPAA: T2DPointArray;
  484. begin
  485. if (not (loggedin)) then
  486. exit;
  487. gametab(tab_inv);
  488. tmpcts := GetColorToleranceSpeed;
  489. ColorToleranceSpeed(CTS);
  490. SetColorSpeed2Modifiers(hMoD, SMoD);
  491. FindColorsSpiralTolerance(MSCX, MSCY, TPA, color[III], x, y, xs, ys, Tol) ColorToleranceSpeed(tmpCTS);
  492. SetColorSpeed2Modifiers(0.2, 0.2);
  493. SplitTPAWrap(TPA, split, TPAA);
  494. SortATPAFromSize(TPAA, sort, true);
  495. for I := 0 to High(TPAA) do
  496. begin
  497. MiddleTPAEx(TPAA[i], X, Y);
  498. MMouse(x, y, RandomRange( - 3, 3), RandomRange( - 3, 3));
  499. if WaitUpTextMulti2(uptext, WaitUptextWait + random(WaitUptextRandom)) then
  500. begin
  501. Result := True;
  502. break;
  503. end;
  504. break;
  505. end;
  506. end;
  507.  
  508. function Clickobject(Objpoint: tpoint; Uptext: TStringArray): Boolean;
  509. var
  510. Bp, Booth: TPoint;
  511. begin
  512. if (not LoggedIn) then
  513. Exit;
  514. if (R_DistanceFromTile(Objpoint) > 3) and (R_DistanceFromTile(Objpoint) < 15) then
  515. begin
  516. Bp.x := Objpoint.x + 1;
  517. Bp.Y := Objpoint.y - 1;
  518. R_WalkPath([Bp]);
  519. wait(randomrange(4000,5000));
  520. end;
  521. if R_DistanceFromTile(Objpoint) < 5 then
  522. begin
  523. Booth := R_TileToMS(ObjPoint);
  524. case random (10) of
  525. 0..5: MMouse(Booth.X, Booth.Y, 2, 2);
  526. 6..8:MMouse(Booth.X, Booth.Y, 3, 3);
  527. 9..10:MMouse(Booth.X, Booth.Y, 4, 4);
  528. end;
  529. Sleep(100 + Random(100));
  530. if (R_IsUpTextMulti(Uptext)) then
  531. begin
  532. result := true;
  533. end;
  534. end;
  535. end;
  536.  
  537.  
  538. function OnRangeScreen: boolean;
  539. var
  540. CTS: Integer;
  541. TPA: Tpointarray;
  542. begin
  543. if (not (loggedin)) then
  544. exit;
  545. cts := GetColorToleranceSpeed;
  546. ColorToleranceSpeed(2);
  547. SetColorSpeed2Modifiers(0.05, 0.41);
  548. result := FindColorsTolerance(TPA, 5334901, 482, 36, 492, 45, 12);
  549. ColorToleranceSpeed(CTS);
  550. SetColorSpeed2Modifiers(0.02, 0.2);
  551. end;
  552.  
  553. procedure closerangescreen;
  554. begin
  555. if (not (loggedin)) then
  556. exit;
  557. writeln('we are on skill screen, closing');
  558. mousebox(482, 36, 492, 45, 1);
  559. end;
  560.  
  561. function OnskillScreen: boolean;
  562. var
  563. CTS: Integer;
  564. TPA: Tpointarray;
  565. begin
  566. if (not (loggedin)) then
  567. exit;
  568. cts := GetColorToleranceSpeed;
  569. ColorToleranceSpeed(2);
  570. SetColorSpeed2Modifiers(0.02, 1.48);
  571. result := FindColorsTolerance(TPA, 8042720, 480, 5, 513, 35, 4);
  572. ColorToleranceSpeed(CTS);
  573. SetColorSpeed2Modifiers(0.02, 0.2);
  574. end;
  575.  
  576. procedure CloseSkillScreen;
  577. begin
  578. if (not (loggedin)) then
  579. exit;
  580. writeln('we are on skill screen, closing');
  581. mousebox(494, 17, 500, 22, 1);
  582. end;
  583.  
  584. function OnmageTab: boolean;
  585. var
  586. Monster: TpointArray;
  587. TmpCts: Integer;
  588. Melee: Boolean;
  589. begin
  590. if (not (loggedin)) then
  591. exit;
  592. tmpCTS := GetColorToleranceSpeed;
  593. ColorToleranceSpeed(2);
  594. SetColorSpeed2Modifiers(0.06, 0.24);
  595. result := FindColorsTolerance(Monster, 1382991, 730, 170, 754, 195, 11) melee := result;
  596. ColorToleranceSpeed(0);
  597. SetColorSpeed2Modifiers(0.2, 0.2);
  598. end;
  599.  
  600. function GotProblem(Problem: string): boolean;
  601. begin
  602. if (not (loggedin)) then
  603. exit;
  604. result := FindTextTPA(clBlack, 0, MCX1, MCY1, MCX2, MCY2, problem, smallChars07, Nothing);
  605. end;
  606.  
  607.  
  608. function OutofRunes: boolean;
  609. begin
  610. if (not (loggedin)) then
  611. exit;
  612. result := FindTextTPA(clBlack, 0, MCX1, MCY1, MCX2, MCY2, 'ody', smallChars07, Nothing);
  613. end;
  614.  
  615. function NoLaws: boolean;
  616. begin
  617. if (not (loggedin)) then
  618. exit;
  619. result := FindTextTPA(clBlack, 0, MCX1, MCY1, MCX2, MCY2, 'Law', smallChars07, Nothing);
  620. end;
  621.  
  622. function AlreadyWeakend:boolean;
  623. begin
  624. if (not(loggedin)) then exit;
  625. result := FindTextTPA(clBlack , 0, MCX1, MCY1, MCX2, MCY2, 'foe', smallChars07, Nothing);
  626. end;
  627.  
  628.  
  629. function NotchatTabAll: boolean;
  630. var
  631. Monster: TpointArray;
  632. TmpCts: Integer;
  633. begin
  634. if (not (loggedin)) then
  635. exit;
  636. tmpCTS := GetColorToleranceSpeed;
  637. ColorToleranceSpeed(2);
  638. SetColorSpeed2Modifiers(0.10, 0.34);
  639. result := FindColorsTolerance(Monster, 4213586, 6, 482, 60, 497, 11);
  640. ColorToleranceSpeed(0);
  641. SetColorSpeed2Modifiers(0.2, 0.2);
  642. end;
  643.  
  644. procedure MakeMyChatTabAll;
  645. begin
  646. if (not (loggedin)) then
  647. exit;
  648. writeln('Our chat Tab is not set to all, making chat tab to all');
  649. mousebox(12, 485, 45, 497, 1);
  650. end;
  651.  
  652. procedure WaitAfterCast;
  653. begin
  654. if (not (loggedin)) then
  655. exit;
  656. case random(600) of
  657. 1..450: Wait(RandomRange(100, 300));
  658. 451..570: Wait(RandomRange(300, 400));
  659. 571..590: Wait(RandomRange(400, 600));
  660. 591..600: Wait(RandomRange(600, 1000));
  661. end;
  662. end;
  663.  
  664. procedure WaitShortClick;
  665. begin
  666. if (not (loggedin)) then
  667. exit;
  668. case random(600) of
  669. 1..450: Wait(RandomRange(100, 150));
  670. 451..570: Wait(RandomRange(150, 200));
  671. 571..590: Wait(RandomRange(200, 250));
  672. 591..600: Wait(RandomRange(250, 400));
  673. end;
  674. end;
  675.  
  676. procedure WaitShortClick2;
  677. begin
  678. if (not (loggedin)) then
  679. exit;
  680. case random(600) of
  681. 1..450: Wait(RandomRange(400, 450));
  682. 451..570: Wait(RandomRange(450, 500));
  683. 571..590: Wait(RandomRange(500, 550));
  684. 591..600: Wait(RandomRange(550, 600));
  685. end;
  686. end;
  687.  
  688. procedure MouseSpeedz;
  689. begin
  690. if (not (loggedin)) then
  691. exit;
  692. case random(600) of
  693. 1..450: MouseSpeed := MainMouseSpeed;
  694. 451..570: MouseSpeed := MainMouseSpeed + randomrange( - 1, 1);
  695. 571..590: MouseSpeed := MainMouseSpeed + randomrange( - 1, 2);
  696. 591..600: MouseSpeed := MainMouseSpeed + randomrange( - 1, 3);
  697. end;
  698. end;
  699.  
  700. procedure FindIfonMagetab;
  701. begin
  702. if (not (loggedin)) then
  703. exit;
  704. if (not (OnmageTab)) then
  705. begin
  706. gametab(tab_magic);
  707. waitshortclick2;
  708. end
  709. else
  710. begin
  711. if (OnmageTab) then
  712. exit;
  713. end;
  714. end;
  715.  
  716. function HoverNearbyNpc: boolean;
  717. var
  718. I: Tpointarray;
  719. P: Integer;
  720. begin
  721. if (not (loggedin)) then
  722. exit;
  723. I := GetMiniMapDots('npc');
  724. if (length(I) > 0) then
  725. begin
  726. SortTPAFrom(i, Point(MMCX, MMCY));
  727. P := random(length(I)) Mmouse(I[0].x, I[0].y, 3, 3);
  728. result := true;
  729. end;
  730. end;
  731.  
  732. procedure Keyboards;
  733. begin
  734. case random(5) of
  735. 0..2:
  736. begin
  737. KeyDown(37);
  738. WaitShortClick KeyUp(37);
  739. WaitShortClick KeyDown(40);
  740. WaitShortClick KeyUp(40);
  741. end;
  742. 3..4:
  743. begin
  744. KeyDown(39);
  745. WaitShortClick KeyUp(39);
  746. WaitShortClick KeyDown(38);
  747. WaitShortClick KeyUp(38);
  748. end;
  749. 5:
  750. begin
  751. KeyDown(38);
  752. WaitShortClick KeyUp(38);
  753. WaitShortClick KeyDown(39);
  754. WaitShortClick KeyUp(39);
  755. end;
  756. end;
  757. end;
  758.  
  759. procedure Antiban;
  760. begin
  761. if (not (loggedin)) then
  762. exit;
  763. case random(100) of
  764. 0..56:
  765. begin
  766. end;
  767. 57..100:
  768. begin
  769. case random(150) of
  770. 10: hoverskill(skill_magic, false);
  771. 15: HoverOnlineFriend;
  772. 20: BoredHuman;
  773. 30: MMouseOffClient('top');
  774. 40: MMouseOffClient('left');
  775. 50: MMouseOffClient('right');
  776. 60: MMouseOffClient('bottom');
  777. 70: SmallRandomMouse;
  778. 80: RandomAngle(1);
  779. 90: RandomAngle(2);
  780. 100: PickUpMouse;
  781. 110: CompassMovement(10, 70, true);
  782. 120: HoverNearbyNpc;
  783. 130: Keyboards;
  784. 140: MissMouse(250, 250);
  785. 150: RandomMovement;
  786. 160: CompassMovement(240, 300, true);
  787. 170: AdjustMouseSpeed(3, 10, 20);
  788. 180: RandomFKeys(true);
  789. 190: RandomTab(true);
  790. end;
  791. end;
  792. end;
  793. end;
  794.  
  795. function LocateMonster1(Color: TintegerArray; Tol, CTS: integer; hMoD, sMoD: Extended; Uptext: array of string): Boolean;
  796. var
  797. bp, orb: tpoint;
  798. begin
  799. if (not (Loggedin)) then
  800. exit;
  801. orb.x := myloc.x;
  802. orb.y := myloc.y + 8;
  803. if R_DistanceFromTile(oRB) > 15 then
  804. exit;
  805. if (R_DistanceFromTile(oRB) > 3) and (R_DistanceFromTile(oRB) < 15) then
  806. begin
  807. Bp.x := orb.x;
  808. Bp.Y := orb.y - 1;
  809. R_WebWalk(bp);
  810. waithumanclick2;
  811. end;
  812. MouseSpeedz;
  813. FindIfonMagetab;
  814. case random(10) of
  815. 0..7: Mouse(RandomRange(668, 669), RandomRange(263, 264), random(3), random(3), mouse_move);
  816. 8..10: Mouse(RandomRange(663, 670), RandomRange(260, 265), random(1), random(1), mouse_move);
  817. end;
  818. if WaitUpTextMulti2(['Curse'], 300) then
  819. begin
  820. clickmouse2(mouse_left);
  821. waitshortclick;
  822. case random(30) of
  823. 0..27: Clickobject(orb, ['Curse']);
  824. 28..30: FindObjExX(cx, cy, ['Curse'], [7571064], 21, 2, 0.59, 0.07, 50, msx1, msy1, msx2, msy2);
  825. end;
  826. wait(randomrange(90, 120));
  827. if WaitUpTextMulti2(['Curse'], 300) then
  828. begin
  829. clickmouse2(mouse_left);
  830. if Didclick(true, 1000) then
  831. begin
  832. IncEx(cast, 29);
  833. progressreport;
  834. case random(100) of
  835. 1:
  836. begin
  837. case random(100) of
  838. 0..80:
  839. begin
  840. end;
  841. 81..100: Antiban;
  842. end;
  843. case random(50) of
  844. 0..42: waitafterCast;
  845. 43..48: waithumanclick2;
  846. 49..50: Wait(randomrange(15000, 25000));
  847. end;
  848. end;
  849. 2:
  850. begin
  851. end;
  852. end;
  853. result := true;
  854. exit;
  855. end
  856. else
  857. begin
  858. inc(Failcast);
  859. exit;
  860. end;
  861. end
  862. else
  863. begin
  864. inc(failcast);
  865. exit;
  866. end;
  867. end
  868. else
  869. begin
  870. inc(failcast);
  871. exit;
  872. end;
  873. end;
  874.  
  875. procedure Inhouseloop;
  876. var
  877. bp, Orb: tpoint;
  878. begin
  879. writeln('yooo');
  880. MakeCompass('w');
  881. setangle(1);
  882. orb.x := myloc.x;
  883. orb.y := myloc.y + 8;
  884. if (orb.x = 0) then
  885. TeleportToHouse;
  886. if (R_DistanceFromTile(oRB) > 3) and (R_DistanceFromTile(oRB) < 25) then
  887. begin
  888. writeln('yoo2o');
  889. Bp.x := orb.x;
  890. Bp.Y := orb.y - 1;
  891. R_WebWalk(bp);
  892. waithumanclick2;
  893. end;
  894. if Clickobject(orb, ['Activate', 'ctivate']) then
  895. begin
  896. clickmouse2(mouse_left);
  897. waithumanclick2;
  898. end;
  899. waithumanclick2;
  900. if Clickobject(orb, ['Banish', 'anish']) then
  901. begin
  902. repeat
  903. WaitHumanClick;
  904. if not loggedin then
  905. exit;
  906. if R_DistanceFromTile(oRB) > 5 then
  907. exit;
  908. if NotOnPvpWorlds then
  909. Termination('we are no longer on a pvp world, ending..');
  910. if NoLaws then
  911. Termination('we have run out of law runes/cant tele, ending');
  912. if (R_GetSkillLevel(skill_magic) >= 94) then
  913. Termination('we have reached 94 mage, woot!, grats ending script');
  914. if AlreadyWeakend then
  915. Termination('We dont have -65 mage bonus');
  916. if OnskillScreen then
  917. CloseSkillScreen;
  918. if (onrangescreen) then
  919. closerangescreen;
  920. if OutofRunes then
  921. Termination('we have run out of runes!');
  922. if (NotchatTabAll) then
  923. MakeMyChatTabAll;
  924. takebreaks;
  925. FindMod;
  926. FindALlrandoms;
  927. LocateMonster1([7571064], 21, 2, 0.59, 0.07, ['Curse']);
  928. until (not loggedin);
  929. end;
  930. end;
  931.  
  932. function OutsideHouse:boolean;
  933. begin
  934. result := (R_inPolygon([point(2957, 3220), point(2957, 3228), point(2950, 3228), point(2950, 3220)])) or (R_inPolygon([Point(2548, 3101), Point(2539, 3101), Point(2539, 3093), Point(2548, 3093)]));
  935. end;
  936.  
  937. procedure mainloop;
  938. begin
  939. if not loggedin then
  940. exit;
  941. if srl_InFight then
  942. TeleportToHouse;
  943. if NoLaws then
  944. Termination('we have run out of law runes/cant tele, ending');
  945. FindMod;
  946. if NotOnPvpWorlds then
  947. Termination('we are no longer on a pvp world, ending..');
  948. FindALlrandoms;
  949. if FindObjExX(cx, cy, ['Activate', 'ctivate', 'Banish', 'anish'], [6982271], 22, 2, 0.30, 0.25, 50, msx1, msy1, msx2, msy2) then
  950. Inhouseloop;
  951. if (not OutsideHouse) and (FindObjExX(cx, cY, ['Portal'], [5774918], 5, 2, 0.15, 4.50, 50, msx1, msy1, msx2, msy2)) then
  952. begin
  953. writeln('yes');
  954. Inhouseloop;
  955. end;
  956. if OutsideHouse and FindObjExX(cx, cY, ['Enter', 'nter', 'ortal', 'Portal'], [5774918], 5, 2, 0.15, 4.50, 50, msx1, msy1, msx2, msy2) then
  957. begin
  958. writeln('yess');
  959. if FindObject([5774918], 5, 2, 0.15, 4.50, 20, 20, ['Enter', 'nter', 'ortal', 'Portal'], 300, 250, msx1, msy1, msx2, msy2) then
  960. begin
  961. writeln('yess2');
  962. if srl_InFight then
  963. TeleportToHouse;
  964. clickmouse2(mouse_left);
  965. wait(randomrange(2000, 3000));
  966. mousebox(180, 375, 325, 390, mouse_left);
  967. wait(randomrange(10000, 15000));
  968. Myloc := R_GetTileGlobal;
  969. end;
  970. end;
  971. if (not OutsideHouse) and not FindObjExX(cx, cY, ['Portal'], [5774918], 5, 2, 0.15, 4.50, 50, msx1, msy1, msx2, msy2) then
  972. begin
  973. writeln('yes2');
  974. if not loggedin then
  975. exit;
  976. if srl_InFight then
  977. TeleportToHouse;
  978. TeleportToHouse;
  979. end;
  980. end;
  981.  
  982. begin
  983. playerSetup;
  984. setupsrl;
  985. SetupReflection;
  986. if NotOnPvpWorlds then
  987. Termination('hi');
  988. StartTime;
  989. LongBreakTimer;
  990. myvars;
  991. R_CombatRandoms := false;
  992. SRL_CombatRandoms := false;
  993. addonterminate('ProgressReport');
  994. repeat
  995. wait(400);
  996. if not loggedin then
  997. loginloop;
  998. if loggedin then
  999. mainloop;
  1000. if NotOnPvpWorlds then
  1001. Termination('we are no longer on a pvp world, ending..');
  1002. until (false);
  1003. end.
Advertisement
Add Comment
Please, Sign In to add comment