zamaro

FHobs (V1)

Mar 8th, 2014
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.09 KB | None | 0 0
  1. program FHobs;
  2. {$DEFINE SMART8}
  3. {$I SRL-OSR/SRL.Simba}
  4. {$I SRL-OSR/SRL/misc/al_functions.simba}
  5. {$I SRL-OSR/SRL/core/antirandoms/C_AntiRandoms.simba}
  6. {$I SRL-OSR/SRL/Reflection/Reflection.simba}
  7.  
  8. var
  9. myloc: tpoint;
  10. cx, cy: integer;
  11.  
  12. procedure playerSetup;
  13. begin
  14. HowManyPlayers := 1;
  15. NumberOfPlayers(HowManyPlayers);
  16. CurrentPlayer := 0;
  17. Players[0].Name := '';
  18. Players[0].Pass := '';
  19. Players[0].Nick := '';
  20. Players[0].Active := True;
  21. end;
  22.  
  23. procedure WaitShortClick;
  24. begin
  25. case random(600) of
  26. 1..450: Wait(RandomRange(100, 150));
  27. 451..570: Wait(RandomRange(150, 200));
  28. 571..590: Wait(RandomRange(200, 250));
  29. 591..600: Wait(RandomRange(250, 400));
  30. end;
  31. end;
  32.  
  33. procedure Keyboards;
  34. begin
  35. case random(5) of
  36. 0..2:
  37. begin
  38. KeyDown(37);
  39. WaitShortClick KeyUp(37);
  40. WaitShortClick KeyDown(40);
  41. WaitShortClick KeyUp(40);
  42. end;
  43. 3..4:
  44. begin
  45. KeyDown(39);
  46. WaitShortClick KeyUp(39);
  47. WaitShortClick KeyDown(38);
  48. WaitShortClick KeyUp(38);
  49. end;
  50. 5:
  51. begin
  52. KeyDown(38);
  53. WaitShortClick KeyUp(38);
  54. WaitShortClick KeyDown(39);
  55. WaitShortClick KeyUp(39);
  56. end;
  57. end;
  58. end;
  59.  
  60. function HoverNearbyNpc: boolean;
  61. var
  62. I: Tpointarray;
  63. P: Integer;
  64. begin
  65. I := GetMiniMapDots('npc');
  66. if (length(I) > 6) then
  67. begin
  68. SortTPAFrom(i, Point(MMCX, MMCY));
  69. P := random(length(I)) Mmouse(I[0].x, I[0].y, 3, 3);
  70. result := true;
  71. end;
  72. end;
  73.  
  74. procedure Antiban;
  75. begin
  76. case random(140) of
  77. 0..2: hoverskill(skill_hitpoints, false);
  78. 3..7.: HoverSkill(skill_strength, False);
  79. 12..15: hoverskill(skill_attack, false);
  80. 16..19: HoverOnlineFriend;
  81. 20: BoredHuman;
  82. 30: MMouseOffClient('top');
  83. 40: MMouseOffClient('left');
  84. 50: MMouseOffClient('right');
  85. 60: MMouseOffClient('bottom');
  86. 70: SmallRandomMouse;
  87. 80: RandomAngle(1);
  88. 90: RandomAngle(2);
  89. 100: PickUpMouse;
  90. 110: CompassMovement(10, 70, true);
  91. 120: HoverNearbyNpc;
  92. 130: Keyboards;
  93. 140: writeln('hi');
  94. end;
  95. end;
  96.  
  97. procedure SecondAntiban2;
  98. begin
  99. case random(20) of
  100. 1: PickUpMouse;
  101. 2: BoredHuman;
  102. 3: MMouseOffClient('left');
  103. 4: MMouseOffClient('right');
  104. 5: MMouseOffClient('bottom');
  105. 6: SmallRandomMouse;
  106. 7: boredhuman;
  107. 8: SmallRandomMouse;
  108. 10: keyboards;
  109. end;
  110. end;
  111.  
  112. function OnCanoeScreen: boolean;
  113. var
  114. Monster: TpointArray;
  115. TmpCts: Integer;
  116. begin
  117. tmpcts := GetColorToleranceSpeed;
  118. ColorToleranceSpeed(2);
  119. SetColorSpeed2Modifiers(1.86, 0.72);
  120. result := FindColorsTolerance(Monster, 5263430, 275, 106, 400, 205, 3);
  121. ColorToleranceSpeed(tmpcts);
  122. SetColorSpeed2Modifiers(0.2, 0.2);
  123. end;
  124.  
  125. function OnFloatScreen: boolean;
  126. var
  127. Monster: TpointArray;
  128. TmpCts: Integer;
  129. begin
  130. tmpcts := GetColorToleranceSpeed;
  131. ColorToleranceSpeed(2);
  132. SetColorSpeed2Modifiers(0.34, 0.32);
  133. result := FindColorsTolerance(Monster, 4223577, MSX1, MSY1, MSX2, MSY2, 1);
  134. ColorToleranceSpeed(tmpcts);
  135. SetColorSpeed2Modifiers(0.2, 0.2);
  136. end;
  137.  
  138. procedure MMouseRandom(x, y: integer);
  139. var
  140. Cx, Cy: Integer;
  141. begin
  142. GetMousePos(Cx, Cy);
  143. AL_SetMouseSpeed(20);
  144. case Random(5) of
  145. 0: AL_BrakeWindMouse(Cx, Cy, x, y, 15 + Random(10), 5 + Random(15), 5, 10, 5, True);
  146. 1: AL_HumanWindMouse(Cx, Cy, x, y, 15 + Random(10), 5 + Random(15), 5, 10, 5);
  147. 2: AL_AccurateMMouse(IntToPoint(x, y), 2, 2);
  148. 3: AL_HumanMMouse(IntToPoint(x, y), 2, 2);
  149. 4: AL_ShiftWindMouse(Cx, Cy, x, y, 15 + Random(10), 5 + Random(15), 5, 10, 20, 5);
  150. 5: AL_MissMouse(IntToPoint(x, y), 2, 2);
  151. end;
  152. end;
  153.  
  154. procedure WaitHumanClick3;
  155. begin
  156. case random(600) of
  157. 1..450: Wait(RandomRange(3000, 5000));
  158. 451..570: Wait(RandomRange(5000, 5500));
  159. 571..590: Wait(RandomRange(6000, 6500));
  160. 591..600: Wait(RandomRange(7000, 7500));
  161. end;
  162. end;
  163.  
  164. procedure myvars;
  165. begin
  166. end;
  167.  
  168. procedure DebugPosition;
  169. begin
  170. repeat
  171. wait(400);
  172. Myloc := R_GetTileGlobal;
  173. writeln(Myloc);
  174. until (false);
  175. end;
  176.  
  177. function GetGreenUptext: string;
  178. var
  179. WhiteT, BlueT, YellowT, OrangeT, GreenT, FoundText: string;
  180. begin
  181. WhiteT := GetTextAtExWrap(8, 8, 300, 21, 0, 5, 1, 14541281, 55, 'UpChars07');
  182. BlueT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 13423640, 65, 'UpChars07');
  183. YellowT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 1235160, 40, 'UpChars07');
  184. OrangeT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 4687583, 53, 'UpChars07');
  185. GreenT := GetTextAtExWrap(8, 8, 300, 21, 0, 5, 1, 120577, 65, 'UpChars07');
  186. FoundText := WhiteT + ' ' + BlueT + YellowT + OrangeT + GreenT;
  187. FoundText := ReplaceWrap(FoundText, '.', '', [rfReplaceAll]);
  188. FoundText := ReplaceWrap(FoundText, '/', '', [rfReplaceAll]);
  189. FoundText := ReplaceWrap(FoundText, '\', '', [rfReplaceAll]);
  190. FoundText := ReplaceWrap(FoundText, ',', '', [rfReplaceAll]);
  191. FoundText := ReplaceWrap(FoundText, '*', '', [rfReplaceAll]);
  192. FoundText := ReplaceWrap(FoundText, '^', '', [rfReplaceAll]);
  193. FoundText := ReplaceWrap(FoundText, '"', '', [rfReplaceAll]);
  194. Result := FoundText;
  195. end;
  196.  
  197. function IsUpTextMultiCustom2(Text: TStringArray): Boolean;
  198. var
  199. TheText: string;
  200. i, n: Integer;
  201. begin
  202. TheText := GetGreenUptext;
  203. n := High(Text);
  204. for i := 0 to n do
  205. if (Pos(Text[i], TheText) > 0) then
  206. begin
  207. Result := True;
  208. Exit;
  209. end;
  210. end;
  211.  
  212. function WaitUpTextMulti2(S: TStringArray; Time: Integer): Boolean;
  213. var
  214. T: Integer;
  215. begin
  216. Result := false;
  217. T := GetSystemTime + Time;
  218. while (GetSystemTime < T) do
  219. begin
  220. if (IsUpTextMultiCustom2(S)) then
  221. begin
  222. Result := True;
  223. Exit;
  224. end;
  225. Wait(20 + Random(20));
  226. end;
  227. end;
  228.  
  229. function FindObjExX(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; Tol, CTS: integer; Hue, Sat: Extended; Step, xs, ys, xe, ye: Integer): Boolean;
  230. var
  231. MidX, MidY, i, j, k, x, y, width, height, HalfWidth, HalfHeight: Integer;
  232. ColorFound: Boolean;
  233. SearchBoxes: array of array of TBox;
  234. p: TPointArray;
  235. begin
  236. if (not (loggedin)) then
  237. exit;
  238. if R_IsAnimating then
  239. exit;
  240. Result := False;
  241. for i := 0 to (GetArrayLength(Color) - 1) do
  242. begin
  243. ColorToleranceSpeed(CTS);
  244. SetColorSpeed2Modifiers(Hue, sat);
  245. if (FindColorSpiralTolerance(cx, cy, Color[i], xs, ys, xe, ye, Tol)) then
  246. begin
  247. ColorToleranceSpeed(1);
  248. SetColorSpeed2Modifiers(0.2, 0.2);
  249. ColorFound := True;
  250. Break;
  251. end;
  252. end;
  253. ColorToleranceSpeed(1);
  254. SetColorSpeed2Modifiers(0.2, 0.2);
  255. if R_IsAnimating then
  256. exit;
  257. if not (ColorFound) then
  258. Exit;
  259. MidX := Round((xe - xs) / 2);
  260. MidY := Round((ye - ys) / 2);
  261. Width := Ceil(abs(xe - xs) / 2 / Step - 0.5) * 2 + 1;
  262. Height := Ceil(abs(ye - ys) / 2 / Step - 0.5) * 2 + 1;
  263. SetLength(SearchBoxes, Width);
  264. HalfWidth := Floor(Width / 2);
  265. HalfHeight := Floor(Height / 2) for x := - 1 * HalfWidth to HalfWidth do
  266. begin
  267. SetLength(SearchBoxes[x + HalfWidth], Height);
  268. for y := - 1 * HalfHeight to HalfHeight do
  269. SearchBoxes[x + HalfWidth][y + HalfHeight] := IntToBox(Max(xs, xs + Round(MidX + ((x - 0.5) * Step))), Max(ys, ys + Round(MidY + ((y - 0.5) * Step))), Min(xe, xs + Round(MidX + ((x + 0.5) * Step))), Min(ye, ys + Round(MidY + ((y + 0.5) * Step))));
  270. end;
  271. p := TPAFromBox(IntToBox(0, 0, Width - 1, Height - 1));
  272. SortTPAFrom(p, Point(floor(Width / 2), floor(Height / 2)));
  273. for k := 0 to High(Color) do
  274. for j := 0 to High(p) do
  275. begin
  276. ColorToleranceSpeed(CTS);
  277. SetColorSpeed2Modifiers(Hue, sat);
  278. if (FindColorTolerance(cx, cy, Color[k], SearchBoxes[p[j].x][p[j].y].x1, SearchBoxes[p[j].x][p[j].y].y1, SearchBoxes[p[j].x][p[j].y].x2, SearchBoxes[p[j].x][p[j].y].y2, Tol)) then
  279. begin
  280. ColorToleranceSpeed(1);
  281. SetColorSpeed2Modifiers(0.2, 0.2);
  282. if R_IsAnimating then
  283. exit;
  284. if OnFloatScreen or OnCanoeScreen then
  285. exit;
  286. MMouse(cx, cy, 3, 3);
  287. wait(randomrange(200, 300));
  288. if (WaitUptextMulti2(Text, 300)) then
  289. begin
  290. ColorToleranceSpeed(1);
  291. SetColorSpeed2Modifiers(0.2, 0.2);
  292. GetMousePos(cx, cy);
  293. Result := True;
  294. Exit;
  295. end;
  296. end;
  297. ColorToleranceSpeed(1);
  298. SetColorSpeed2Modifiers(0.2, 0.2);
  299. end;
  300. ColorToleranceSpeed(1);
  301. SetColorSpeed2Modifiers(0.2, 0.2);
  302. end;
  303.  
  304. procedure WaitHumanClick;
  305. begin
  306. case random(600) of
  307. 1..450: Wait(RandomRange(400, 600));
  308. 451..570: Wait(RandomRange(400, 600));
  309. 571..590: Wait(RandomRange(600, 800));
  310. 591..600: Wait(RandomRange(800, 1000));
  311. end;
  312. end;
  313.  
  314. procedure WaitHumanClick2;
  315. begin
  316. case random(600) of
  317. 1..450: Wait(RandomRange(1000, 1500));
  318. 451..570: Wait(RandomRange(1500, 2000));
  319. 571..590: Wait(RandomRange(2000, 2500));
  320. 591..600: Wait(RandomRange(2500, 3000));
  321. end;
  322. end;
  323.  
  324. function OpenWScreen: Boolean;
  325. begin
  326. Result := False;
  327. if WorldScreen then
  328. exit;
  329. if Loggedin then
  330. Exit;
  331. if not WorldScreen then
  332. begin
  333. Mmouse(54, 475, 1, 1);
  334. WaitHumanClick;
  335. ClickMouse2(Mouse_Left);
  336. waithumanclick;
  337. Result := True;
  338. end;
  339. end;
  340.  
  341. function whitecolor: boolean;
  342. var
  343. Monster: TpointArray;
  344. TmpCts: Integer;
  345. begin
  346. tmpcts := GetColorToleranceSpeed;
  347. ColorToleranceSpeed(2);
  348. SetColorSpeed2Modifiers(0.22, 1.69);
  349. result := FindColorsTolerance(Monster, 9163999, 192, 67, 583, 469, 4);
  350. ColorToleranceSpeed(tmpcts);
  351. SetColorSpeed2Modifiers(0.2, 0.2);
  352. end;
  353.  
  354. procedure loginloop;
  355. begin
  356. case random(10) of
  357. 0..3:
  358. begin
  359. OpenWorldScreen;
  360. repeat
  361. if whitecolor then
  362. break;
  363. if whitecolor then
  364. writeln('yeaya');
  365. if not whitecolor then
  366. writeln('yea22ya');
  367. case random(10) of
  368. 0..2: mouse(randomrange(397, 554), randomrange(78, 394), 1, 1, mouse_move);
  369. 3..4: mouse(randomrange(298, 462), randomrange(200, 392), 1, 1, mouse_move);
  370. 5..6: mouse(randomrange(205, 555), randomrange(80, 154), 1, 1, mouse_move);
  371. 7..10: mouse(randomrange(211, 555), randomrange(246, 367), 1, 1, mouse_move);
  372. end;
  373. until (whitecolor) if whitecolor then
  374. begin
  375. clickmouse2(mouse_left);
  376. waithumanclick;
  377. currentworld;
  378. waithumanclick;
  379. if (CurrentWorldLS = 365) then
  380. exit;
  381. waithumanclick;
  382. loginplayer;
  383. exit;
  384. end;
  385. end;
  386. 4..10: loginplayer;
  387. end;
  388. end;
  389.  
  390. procedure equipitems;
  391. var
  392. i, n: integer;
  393. begin
  394. for i := 0 to 5 do
  395. begin
  396. MMouseItem(i) if IsUpTextMultiCustom2(['Rune', 'une']) then
  397. begin
  398. clickmouse2(mouse_left);
  399. waithumanclick2;
  400. end;
  401. end;
  402. end;
  403.  
  404. function InLumbridge: boolean;
  405. var
  406. tpa: tpointarray;
  407. begin
  408. result := R_inPolygon([Point(3216, 3228), Point(3226, 3228), Point(3226, 3212), Point(3217, 3209)]);
  409. end;
  410.  
  411. function Atmoss: boolean;
  412. var
  413. tpa: tpointarray;
  414. begin
  415. result := R_inPolygon([Point(3136, 3787), Point(3151, 3787), Point(3155, 3804), Point(3136, 3804)]);
  416. end;
  417.  
  418. procedure gohobs;
  419. begin
  420. writeln('we are going hobs!');
  421. R_PerfectPath([Point(3141, 3793), Point(3136, 3793), Point(3132, 3789), Point(3128, 3785), Point(3123, 3784), Point(3118, 3782), Point(3114, 3779), Point(3110, 3776), Point(3107, 3772), Point(3105, 3767), Point(3101, 3764), Point(3096, 3763), Point(3091, 3762)]);
  422. end;
  423.  
  424. procedure Gocanoe;
  425. begin
  426. writeln('we are canoing');
  427. equipitems;
  428. SetFightMode(3);
  429. MakeCompass(randomrange(355, 35));
  430. setangle(0);
  431. R_PerfectPath([Point(3223, 3218), Point(3228, 3218), Point(3232, 3221), Point(3236, 3225), Point(3241, 3226), Point(3246, 3226), Point(3251, 3226), Point(3256, 3227), Point(3253, 3231), Point(3248, 3233)]);
  432. end;
  433.  
  434. function AtCanoe: boolean;
  435. var
  436. tpa: tpointarray;
  437. begin
  438. result := R_inPolygon([Point(3255, 3225), Point(3235, 3225), Point(3225, 3241), Point(3255, 3241)]);
  439. end;
  440.  
  441. procedure canoeUp;
  442. var
  443. IAm: integer;
  444. begin
  445. writeln('we are canoing up!');
  446. FindNormalRandoms;
  447. FindNonInventoryRandoms;
  448. if not R_IsAnimating then
  449. begin
  450. FindNormalRandoms;
  451. FindNonInventoryRandoms;
  452. if R_IsAnimating then
  453. exit;
  454. if OnCanoeScreen then
  455. Mouse(randomrange(185, 400), randomrange(58, 75), randomrange( - 3, 3), randomrange( - 3, 3), mouse_left);
  456. if OnFloatScreen then
  457. Mouse(randomrange(218, 225), randomrange(95, 102), randomrange( - 3, 3), randomrange( - 3, 3), mouse_left);
  458. if not OnCanoeScreen or not OnFloatScreen then
  459. begin
  460. FindNormalRandoms;
  461. FindNonInventoryRandoms;
  462. if R_IsAnimating then
  463. exit;
  464. if (not OnCanoeScreen or not OnFloatScreen) and FindObjExX(cx, cy, ['Station', 'tation'], [205363], 5, 2, 0.15, 2.23, 50, MSX1, MSY1, MSX2, MSY2) then
  465. Clickmouse2(mouse_left);
  466. if R_IsAnimating then
  467. exit;
  468. if (not OnCanoeScreen or not OnFloatScreen) and FindObjExX(cx, cy, ['Station', 'tation'], [205363], 5, 2, 0.15, 2.23, 50, MSX1, MSY1, MSX2, MSY2) then
  469. Clickmouse2(mouse_left);
  470. if R_IsAnimating then
  471. exit;
  472. if (not OnCanoeScreen or not OnFloatScreen) and FindObjExX(cx, cy, ['Station', 'tation'], [8503], 2, 2, 0.15, 0.00, 50, MSX1, MSY1, MSX2, MSY2) then
  473. Clickmouse2(mouse_left);
  474. end;
  475. if R_IsAnimating then
  476. exit;
  477. end;
  478. end;
  479.  
  480. function AtHobs: boolean;
  481. var
  482. tpa: tpointarray;
  483. begin
  484. result := R_inPolygon([Point(3106, 3745), Point(3104, 3781), Point(3067, 3779), Point(3067, 3749)]);
  485. end;
  486.  
  487. procedure idle;
  488. begin
  489. writeln('we are at hobs, idling');
  490. FindNormalRandoms FindNonInventoryRandoms;
  491. if not loggedin then
  492. exit;
  493. if not R_WaitForAnimation(randomrange(50000, 180000)) then
  494. begin
  495. if not loggedin then
  496. exit;
  497. case random(20) of
  498. 0..8: Antiban;
  499. 9..20: writeln('not doing antiban');
  500. end;
  501. if not loggedin then
  502. exit;
  503. case random(3) of
  504. 1: writeln('doing nothing');
  505. 2: setangle(0);
  506. 3: setangle(1);
  507. end;
  508. if not loggedin then
  509. exit;
  510. case random(10) of
  511. 1..6: writeln('doing nothingx2');
  512. 7: MakeCompass('n');
  513. 8: MakeCompass('s');
  514. 9: MakeCompass('w');
  515. 10: MakeCompass('e');
  516. end;
  517. if not loggedin then
  518. exit;
  519. case random(10) of
  520. 1..4: R_WebWalk(point(3049, 3764));
  521. 5..6: R_WebWalk(Point(3088, 3722));
  522. 7..8: R_WebWalk(point(3131, 3762));
  523. 9..10: R_WebWalk(Point(3086, 3797));
  524. end;
  525. if not loggedin then
  526. exit;
  527. r_webwalk(Point(3087, 3763));
  528. end;
  529. end;
  530.  
  531. procedure mainloop;
  532. begin
  533. if not loggedin then
  534. exit;
  535. FindNormalRandoms;
  536. FindNonInventoryRandoms;
  537. if inLumbridge then
  538. GoCanoe;
  539. if AtCanoe then
  540. Canoeup;
  541. if AtMoss then
  542. Gohobs;
  543. if Athobs then
  544. idle;
  545. end;
  546.  
  547. begin
  548. playerSetup;
  549. setupsrl;
  550. SetupReflection;
  551. SRL_CombatRandoms := False;
  552. repeat
  553. wait(400);
  554. if not loggedin then
  555. loginloop;
  556. wait(400);
  557. if loggedin then
  558. mainloop;
  559. until (false);
  560. end.
Advertisement
Add Comment
Please, Sign In to add comment