Advertisement
Guest User

MIME HERE, L000000000000000000l

a guest
Sep 2nd, 2015
575
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.78 KB | None | 0 0
  1. program FFACW;
  2. {$DEFINE SMART}
  3. {$I SRL-6/SRL.simba}
  4. {$I SPS/lib/sps-rs3.simba}
  5.  
  6. var
  7. PEOPLE: TStringArray = ['ttack Resurrect v2',
  8. 'ttack Miacon Jr',
  9. 'ttack Bus action',
  10. 'ttack agent arr0w',
  11. {put here the} 'ttack Viznaw',
  12. {names of the} 'ttack Miacon',
  13. {kids u ns} 'ttack Amoxile',
  14. 'ttack Amoxyle',
  15. 'ttack squad appie',
  16. 'ttack Aws Da King',
  17. 'ttack Ad0rable',
  18. 'ttack Pk Smoke v1',
  19. 'ttack Pk smoke v2',
  20. 'ttack Sith998huntr',
  21. 'ttack Krissy',
  22. 'ttack Recyle toy',
  23. 'ttack Cath is pr0',
  24. 'ttack Viznaw Jr',
  25. 'ttack God Hates u',
  26. 'ttack Imtalented',
  27. 'ttack Barbyland',
  28. 'ttack Barples',
  29. 'ttack H U L K K Y',
  30.  
  31. 'ttack PermPurple',
  32. 'ttack 123heart',
  33. 'ttack Sag Nasty',
  34. 'ttack Squad God',
  35. 'ttack YouFailedMe',
  36. 'ttack BetterShorie',
  37. 'ttack Fff',
  38. 'ttack King of FfA',
  39. 'ttack Glint',
  40. 'ttack Jzzr',
  41. 'ttack Curry Ones',
  42. 'ttack Electus King',
  43. 'ttack TruEmpeor',
  44. 'ttack zStephy',
  45. 'ttack Maarkk',
  46. 'ttack Werewolf529',
  47. 'ttack IV Cres',
  48. 'ttack DONT KNOW NM',
  49. 'ttack Dead',
  50. 'ttack ',
  51. 'ttack ',
  52. 'ttack ',
  53. 'ttack ',
  54. 'ttack ',
  55. 'ttack Markk',
  56. 'ttack Mark',
  57. 'ttack ',
  58. 'ttack ',
  59. 'ttack ',
  60. 'ttack ',
  61. 'ttack ',
  62. 'ttack ',
  63. 'ttack ',
  64. 'ttack ',
  65. 'ttack ',
  66. 'ttack ',
  67. 'ttack ',
  68. 'ttack ',
  69. 'ttack ',
  70. 'ttack ',
  71. 'ttack ',
  72. 'ttack ',
  73. 'ttack ',
  74. 'ttack ',
  75. 'ttack ',
  76. 'ttack ',
  77. 'ttack ',
  78. 'ttack ',
  79. 'ttack ',
  80. 'ttack ',
  81. 'ttack ',
  82. 'ttack ',
  83. 'ttack ',
  84. 'ttack ',
  85. 'ttack ',
  86. 'ttack ',
  87. 'ttack ',
  88. 'ttack ',
  89. 'ttack ',
  90. 'ttack ',
  91. 'ttack ',
  92. 'ttack ',
  93. 'ttack ',
  94. 'ttack ',
  95. 'ttack ',
  96. 'ttack ',
  97. 'ttack ',
  98.  
  99.  
  100.  
  101.  
  102.  
  103. //======================== RS3 NS bot===============================
  104. //================== Set up NS BOT underneath=======================
  105.  
  106. PRAYERS: integer = 1; //Use quick prayers? 1 = true 0 = false
  107. ATTACK: integer = 1; //NS people? 1 = true 0 = false
  108. LOCATION: string = 'NORMAL'; //HILLS - POND- REST or NORMAL *(Antilure only for NORMAL and REST atm)
  109. WORLD: integer = 3; //What world? 80 or 3 (Must be on your favs)
  110. PLAYERNAME: string = 'boss'; //Your player username from Player Manager list
  111.  
  112. xpthen, xpnow, gainedxp, deaths, randnum, lures: integer; //leave this or permd
  113. limit: integer = 10;
  114. talked: integer = 1; // autotalk? 1= true 0 = false
  115.  
  116. //**only edit (declare players procedure) and (talk procedure) under here else permd
  117. //==================================PERMD===============================
  118.  
  119. {---------------------------------------------------}
  120. {---------Draw Debug - Status line for user---------}
  121. {---------------------------------------------------}
  122. procedure writeStatus(status: string);
  123. begin
  124. with (smartImage) do
  125. begin
  126. clearArea(Mainscreen.getBounds());
  127. clearArea(intToBox(0, 0, 574, 16));
  128. drawBox(36, 355 , 294, 375, true, clAqua);
  129. drawText('NsBot 1.3 by 3ast', point(5, 5), UpCharsEx, false, clRed);
  130. drawText('Status: ' + status, point(45, 358), UpCharsEx, false, clRed);
  131. end;
  132. end;
  133.  
  134. {---------------------------------------------------}
  135. {-------Check if a clan vex has been opened---------}
  136. {---------------------------------------------------}
  137. function checkVex(): boolean;
  138. const
  139. VEX_COLOR = 256;
  140. begin
  141. if result := getColor(157, 125) = VEX_COLOR then
  142. begin
  143. wait(250);
  144. WriteStatus('checkVex Result : ' + toStr(Result));
  145. end;
  146. end;
  147. {---------------------------------------------------}
  148. {-------Check if a red portal warning open----------}
  149. {---------------------------------------------------}
  150. function checkRed(): boolean;
  151. const
  152. REDD_COLOR = 1118717;
  153. begin
  154. if result := getColor(180, 75) = REDD_COLOR then
  155. begin
  156. wait(250);
  157. WriteStatus('checkRed Result : ' + toStr(Result));
  158. end;
  159. end;
  160. {---------------------------------------------------}
  161. {-------CLOSE red portal warning--------------------}
  162. {---------------------------------------------------}
  163. procedure closeRed();
  164. var
  165. box: TBox;
  166. begin
  167. writestatus('Closing red.');
  168. box := intToBox(466, 76, 471, 82);
  169. mouseBox(box, MOUSE_LEFT);
  170. wait(randomRange(200,500));
  171. smallRandommouse();
  172. end;
  173.  
  174. {--------------------------------------------------}
  175. {----Close vex - Used to remove clan vex screen----}
  176. {--------------------------------------------------}
  177. procedure closeVex();
  178. var
  179. box: TBox;
  180. begin
  181. writestatus('Closing clan vex.');
  182. box := intToBox(504, 53, 509, 60);
  183. mouseBox(box, MOUSE_LEFT);
  184. wait(randomRange(200,500));
  185. smallRandommouse();
  186. end;
  187.  
  188.  
  189. {---------------------------------------------------}
  190. {--------Check if the Poll screen is open-----------}
  191. {---------------------------------------------------}
  192. function checkPoll(): boolean;
  193. const
  194. POLL_COLOR = 4245242;
  195. begin
  196. result := getColor(424, 124) = POLL_COLOR;
  197. end;
  198.  
  199. {--------------------------------------------------}
  200. {------Close Poll - Used to remove poll screen-----}
  201. {--------------------------------------------------}
  202. procedure closePoll();
  203. var
  204. box: TBox;
  205. begin
  206. writeStatus('Closing poll.');
  207. box := intToBox(364, 123, 426, 132);
  208. mouseBox(box, MOUSE_LEFT);
  209. wait(randomRange(200,500));
  210. smallRandommouse();
  211. end;
  212.  
  213. {---------------------------------------------------}
  214. {---------Check for 'Items safe on death'-----------}
  215. {---------------------------------------------------}
  216. function inSafe(): boolean;
  217. const
  218. SAFE_COLOR = 2070783;
  219. begin
  220. result := getColor(538, 219) = SAFE_COLOR;
  221. end;
  222.  
  223. {---------------------------------------------------}
  224. {---------- Find green portal Antilure ------------}
  225. {---------------------------------------------------}
  226. function findGreenPort(): boolean;
  227. var
  228. x, y: integer;
  229. begin
  230.  
  231. if not inSafe() then exit();
  232.  
  233. if mainscreen.findObject(x, y, 2123333, 21, ['Portal'], MOUSE_MOVE) then
  234. begin
  235. result := 1;
  236. end else
  237. begin
  238. result := 0;
  239. end;
  240. end;
  241.  
  242. {---------------------------------------------------}
  243. {----------Check if we are at the towers------------}
  244. {---------------------------------------------------}
  245. function atTowers(): boolean;
  246. var
  247. x, y: integer;
  248. begin
  249. result := findColorTolerance(x, y, 9739681, mainscreen.getBounds(), 4);
  250. end;
  251.  
  252. {---------------------------------------------------}
  253. {---------Check for water/pond on minimap-----------}
  254. {---------------------------------------------------}
  255. function findWater(): boolean;
  256. var
  257. x, y: integer;
  258. begin
  259. if (LOCATION='POND') then exit();
  260. if result := findColorTolerance(x, y, 5399860, intToBox(706, 133, 767, 147), 5) then
  261. begin
  262. wait(200);
  263. WriteStatus('findWater Result : ' + toStr(Result));
  264. end;
  265. end;
  266.  
  267. function findTrees(): boolean;
  268. var
  269. x, y: integer;
  270. begin
  271. if (LOCATION='HILLS') or (LOCATION='POND') then exit();
  272. if result := findColorTolerance(x, y, 994876, intToBox(672, 32, 747, 42), 5) then
  273. begin
  274. wait(250);
  275. WriteStatus('findTrees Result : ' + toStr(Result));
  276. end;
  277. end;
  278.  
  279. function findWest(): boolean;
  280. var
  281. x, y: integer;
  282. begin
  283. if (LOCATION='HILLS') or (LOCATION='POND') then exit();
  284. if result := findColorTolerance(x, y, 929083, intToBox(706, 125, 669, 83), 5) then
  285. begin
  286. wait(250);
  287. WriteStatus('findWest Result : ' + toStr(Result));
  288. end;
  289. end;
  290.  
  291. function findEast(): boolean;
  292. var
  293. x, y: integer;
  294. begin
  295. if (LOCATION='HILLS') or (LOCATION='POND') then exit();
  296. if result := findColorTolerance(x, y, 993848, intToBox(706, 125, 669, 83), 5) then
  297. begin
  298. wait(250);
  299. WriteStatus('findEast Result : ' + toStr(Result));
  300. end;
  301. end;
  302.  
  303. {---------------------------------------------------}
  304. {------------Check for lava on minimap--------------}
  305. {---------------------------------------------------}
  306. function findLava(): boolean;
  307. var
  308. x, y: integer;
  309. begin
  310. result := findColorTolerance(x, y, 1014713, intToBox(626, 27, 745, 169), 4);
  311. end;
  312.  
  313. {---------------------------------------------------}
  314. {---------Declare Player - Log the user in----------}
  315. {---------------------------------------------------}
  316. procedure declarePlayers();
  317. begin
  318. players.setup(['joe blo89'], 'default');
  319. currentPlayer := 0;
  320. repeat
  321. players[0].loginToLobby();
  322. wait(randomRange(1000, 3000));
  323. Lobby.quickSelectWorld(WORLD);
  324. wait(randomRange(12000, 20000));
  325. until not lobby.isOpen();
  326.  
  327. wait(randomRange(1000,2000));
  328. mainscreen.setAngle(MS_ANGLE_HIGH);
  329. wait(randomRange(1000,2000));
  330. minimap.setAngle(MM_DIRECTION_EAST);
  331. wait(randomRange(1000,2000));
  332.  
  333. mainscreen.setZoom(true);
  334. exitTreasure();
  335.  
  336. if checkPoll() then
  337. closePoll();
  338.  
  339. end;
  340.  
  341. {---------------------------------------------------}
  342. {---------Draw Debug - Status line for user---------}
  343. {---------------------------------------------------}
  344. procedure getXP();
  345. begin
  346. xpnow := chatbox.getXPBar();
  347. gainedxp := (xpnow-xpthen);
  348. end;
  349.  
  350. {---------------------------------------------------}
  351. {---------Check for 'Walk north to fight'-----------}
  352. {---------------------------------------------------}
  353. function FindNorth(): boolean;
  354. const
  355. INTERFACE_COLOR = 3635889;
  356. var
  357. TPA: TPointArray;
  358. searchArea := intToBox(138, 5, 437, 52);
  359. begin
  360. result := FindColors(TPA, INTERFACE_COLOR, searchArea);
  361. end;
  362.  
  363. {---------------------------------------------------}
  364. {-------Check if the examine screen is open---------}
  365. {---------------------------------------------------}
  366. function checkExamine(): boolean;
  367. const
  368. EXAMINE_COLOR = 4217053;
  369. begin
  370. result := getColor(218, 19) = EXAMINE_COLOR;
  371. end;
  372.  
  373. {--------------------------------------------------}
  374. {---Close examine Used to remove examine screen---}
  375. {--------------------------------------------------}
  376. procedure closeExamine();
  377. var
  378. box: TBox;
  379. begin
  380. writeStatus('Closing examine player.');
  381. box := intToBox(211, 18, 220, 24);
  382. mouseBox(box, MOUSE_LEFT);
  383. wait(randomRange(200,500));
  384. smallRandommouse();
  385. end;
  386.  
  387. {--------------------------------------------------}
  388. {---------- Talk - Used as an antiban -------------}
  389. {--------------------------------------------------}
  390. procedure Talk();
  391. var
  392. i: integer;
  393. MESSAGES: TStringArray := ['tinyurl/resv2logged',
  394. 'tinyurl/resv2logged',
  395. 'tinyurl/resv2logged',
  396. 'tinyurl/resv2logged',
  397. 'tinyurl/resv2logged',
  398. 'tinyurl/resv2logged'
  399. 'tinyurl/resv2logged'
  400. 'tinyurl/resv2logged'];
  401. RAND: integer;
  402. MESSAGE: string;
  403. begin
  404.  
  405. if (talked = 0) then exit;
  406.  
  407. RAND := randomRange(1, high(MESSAGES));
  408. MESSAGE := MESSAGES[RAND];
  409. talked := 1;
  410. TypeByte(VK_RETURN);
  411. wait(randomRange(2000,5000));
  412.  
  413. for i:=1 to Length(MESSAGE) do
  414. SendKeys(MESSAGE[i], 18 + Random(17), 22 + Random(12));
  415.  
  416. wait(randomRange(2000,5000));
  417. TypeByte(VK_RETURN);
  418. end;
  419.  
  420.  
  421. {---------------------------------------------------}
  422. {----------Check for multi crosses to log-----------}
  423. {---------------------------------------------------}
  424. function inMulti(): boolean;
  425. const
  426. MULTI_COLOR = 343638;
  427. begin
  428. if result := getColor(258, 29) = MULTI_COLOR then
  429. begin
  430. WriteStatus('inMulti Result : ' + toStr(Result));
  431. end;
  432. end;
  433.  
  434. {--------------------------------------------------}
  435. {--------Check if Qucik Prayers are enabled--------}
  436. {--------------------------------------------------}
  437. function prayersOn(): boolean;
  438. const
  439. PRAYERS = 14054042;
  440. begin
  441. result := getColor(305, 401) = PRAYERS;
  442. end;
  443.  
  444. {--------------------------------------------------}
  445. {------Toggle Prayers - Used for NSing people------}
  446. {--------------------------------------------------}
  447. procedure togglePrayer();
  448. var
  449. box: TBox;
  450. begin
  451. if PRAYERS = 0 then exit();
  452.  
  453. writeStatus('Toggling prayers.');
  454. box := intToBox(303, 402, 309, 408);
  455. mouseBox(box, MOUSE_LEFT);
  456. end;
  457.  
  458. {--------------------------------------------------}
  459. {---------WalkTo - Walks us to location------------}
  460. {--------------------------------------------------}
  461. procedure walkTo(loc: string);
  462. var
  463. north, northh, northhh, northhhh, multi, pond, second, third, sit: Tbox;
  464. begin
  465.  
  466. if (PRAYERS=1) then
  467. begin
  468. case random(30) of
  469. 1..25: if (not prayersOn()) then togglePrayer();
  470. end;
  471. end;
  472.  
  473. case lowerCase(loc) of
  474. 'rest':
  475. case random(100) of
  476. 1..45: begin
  477. northhh := intToBox(695, 101, 702, 109);
  478. mouseBox(northhh, MOUSE_LEFT);
  479. wait(randomrange(2000,5000));
  480. sit := intToBox(766,27,781,39);
  481. mouseBox(sit, Mouse_RIGHT);
  482. wait(randomrange(1300,1900));
  483. chooseOption.select(['est']);
  484. wait(250);
  485. smallRandommouse();
  486. WriteStatus('Resting as antiban.');
  487. wait(randomrange(45000,235000));
  488. end;
  489. 46..100: begin
  490. northhhh := intToBox(703, 101, 712, 110);
  491. mouseBox(northhhh, MOUSE_LEFT);
  492. wait(randomrange(2000,5000));
  493. sit := intToBox(766,27,781,39);
  494. mouseBox(sit, Mouse_RIGHT);
  495. wait(randomrange(1200,1800));
  496. chooseOption.select(['est']);
  497. wait(250);
  498. smallRandommouse();
  499. WriteStatus('Resting as antiban.');
  500. wait(randomrange(30000,200000));
  501. end;
  502. end;
  503.  
  504. 'hills':
  505. begin
  506. writeStatus('Walking to hills.');
  507. multi := intToBox(785, 80, 785, 105);
  508. mouseBox(multi, MOUSE_LEFT);
  509. wait(randomRange(8000, 8500));
  510. second := intToBox(700, 100, 708 , 115);
  511. mouseBox(second, MOUSE_LEFT);
  512. writeStatus('We are at hills.');
  513. wait(randomRange(2000, 2500));
  514. end;
  515.  
  516. 'pond':
  517. begin
  518. case random(100) of
  519. 1..35: begin
  520. writeStatus('Walking to pond.');
  521. pond := intToBox(683, 159, 688, 174);
  522. mouseBox(pond, MOUSE_LEFT);
  523. wait(randomRange(7000, 7580));
  524. second := intToBox(786, 114, 792, 122);
  525. mouseBox(second, MOUSE_LEFT);
  526. wait(randomRange(7000, 8000));
  527. //third := intToBox(703, 99, 712, 113);
  528. //mouseBox(third, MOUSE_LEFT);
  529. //wait(randomRange(1000, 2000));
  530. writeStatus('We are at pond.');
  531. end;
  532. 35..100: begin
  533. writeStatus('Walking to pond.');
  534. pond := intToBox(738, 163, 754, 172);
  535. mouseBox(pond, MOUSE_LEFT);
  536. wait(randomRange(8000, 9000));
  537. second := intToBox(727, 115, 740, 130);
  538. mouseBox(second, MOUSE_LEFT);
  539. wait(randomRange(3000, 4000));
  540. writeStatus('We are at pond.');
  541. end;
  542. end;
  543. end;
  544.  
  545. 'normal':
  546. begin
  547. writeStatus('Walking north.');
  548. case Random(200) of
  549. 1..67:
  550. begin
  551. north := intToBox(340, 120, 480, 350);
  552. mouseBox(north, MOUSE_MOVE);
  553. fastClick(MOUSE_RIGHT);
  554. chooseOption.select(['alk here']);
  555. end;
  556. 68..130:
  557. begin
  558. northh := intToBox(690, 100, 700, 113);
  559. mouseBox(northh, MOUSE_LEFT);
  560. wait(250);
  561. smallRandommouse(); ;
  562. end;
  563. 131..175:
  564. begin
  565. case random(8) of
  566. 1: mouse(point(695, 102), mouse_Left, MOUSE_ACCURATE);
  567. 2: mouse(point(699, 114), mouse_Left, MOUSE_ACCURATE);
  568. 3: mouse(point(323, 235), mouse_Left, MOUSE_ACCURATE);
  569. 4: mouse(point(700, 108), mouse_Left, MOUSE_ACCURATE);
  570. 5: mouse(point(700, 91), mouse_Left, MOUSE_ACCURATE);
  571. 6: mouse(point(706, 97), mouse_Left, MOUSE_ACCURATE);
  572. 7: mouse(point(700, 119), mouse_Left, MOUSE_ACCURATE);
  573. 8: mouse(point(357, 71), mouse_Left, MOUSE_ACCURATE);
  574. end;
  575. end;
  576. end;
  577. wait(randomRange(3500, 4500));
  578. end;
  579. end;
  580.  
  581. end;
  582.  
  583.  
  584. {------Click Portal - Clicks the white portal-------}
  585. {---------------------------------------------------}
  586. function clickPortal: Boolean;
  587. var
  588. tFrame, tFrameEdge, tPortal, tPortalEdge, tEdge: TPointArray;
  589. aEdge: T2DPointArray;
  590. i, safeCheck, AE: Integer;
  591. p: TPoint;
  592. b: TBox;
  593. begin
  594. Result := False;
  595.  
  596. begin
  597. case random(1000) of
  598. 1..30: begin
  599. WriteStatus('Doing mini antiban');
  600. case random(4) of
  601. 0: wait(randomRange(1000,10000));
  602. 1: sleepAndMoveMouse(1000 + random(2000));
  603. 2: wait(randomRange(2000,20000));
  604. 3: sleepAndMoveMouse(2000 + random(4000));
  605. end;
  606. end;
  607. end;
  608. end;
  609.  
  610. if not minimap.isRunEnabled() then
  611. minimap.toggleRun(true);
  612.  
  613. Inc(AE);
  614.  
  615. if (AE >= randomrange(3,4)) then
  616. begin
  617. minimap.clickCompass();
  618. AE := 0;
  619. end;
  620.  
  621. FindColorsTolerance(tFrame, 1065555, Mainscreen.getBounds(), 5, ColorSetting(2, 0.15, 0.51));
  622. tFrameEdge := FindTPAEdges(tFrame);
  623. FindColorsTolerance(tPortal, 10265781, Mainscreen.getBounds(), 20, ColorSetting(2, 0.27, 0.40));
  624. tPortalEdge := FindTPAEdges(tPortal);
  625. if (Length(tFrameEdge) < 10) or (Length(tPortalEdge) < 10) then
  626. Exit(False);
  627. for i := 0 to High(tPortalEdge) do
  628. if (NearbyPointInArrayEx(tPortalEdge[i], 5, 5, tFrameEdge)) then
  629. Insert(tPortalEdge, tEdge);
  630. aEdge := ClusterTPAEx(tEdge, 5, 5);
  631. SortATPAFromMidPoint(aEdge, Mainscreen.playerPoint);
  632. for i := 0 to High(aEdge) do
  633. begin
  634. if (Length(aEdge[i]) < 20) then
  635. Continue();
  636. p := MiddleTPA(aEdge[i]);
  637. b := IntToBox(p.x - 12, p.y - 10, p.x + 12, p.y + 10);
  638. b.setLimit(Mainscreen.getBounds());
  639. WriteStatus('Searching for safe portal');
  640. if (getPixelShift(b, 100) > 200) then
  641. begin
  642. MouseSpeed := RandomRange(40, 70);
  643. Mouse(b.getRandomPoint());
  644. if (isMouseOverText(['(safe)'])) then
  645. begin
  646. case Random(75) of
  647. 0..25:
  648. begin
  649. FastClick(MOUSE_LEFT);
  650. wait(random(500, 780));
  651. end;
  652. 26..50:
  653. begin
  654. FastClick(MOUSE_LEFT);
  655. wait(random(500, 3000));
  656. smallRandomMouse();
  657. end;
  658. 51..75:
  659. begin
  660. FastClick(MOUSE_LEFT);
  661. wait(randomRange(100, 200));
  662. sleepAndMoveMouse(100 + random(200));
  663. wait(randomRange(400, 700));
  664. togglePrayer();
  665. end;
  666. end;
  667. wait(randomrange(500,1000));
  668. if (minimap.isFlagPresent(Random(3000, 4000))) then
  669. Minimap.waitPlayerMoving();
  670. Exit(True);
  671. end;
  672. end;
  673. end;
  674. end;
  675.  
  676. {---------------------------------------------------}
  677. {----------------- Debugs TPA'S --------------------}
  678. {---------------------------------------------------}
  679. function DATPAB(MaATPA: T2DPointArray): TPoint;
  680. var
  681. i: integer;
  682. begin
  683. for I := 0 to (High(MaATPA)) do
  684. begin
  685. result := MaATPA[i].getMiddle();
  686. with (smartImage) do
  687. begin
  688. try
  689. drawPolygon([point(result.x, result.y + 5), point(result.x, result.y + 25)], clLime);
  690. drawPolygon([point(result.x + 5, result.y), point(result.x + 25, result.y)], clLime);
  691. drawPolygon([point(result.x - 5, result.y), point(result.x - 25, result.y)], clLime);
  692. drawPolygon([point(result.x, result.y - 5), point(result.x, result.y - 25)], clLime);
  693. drawCross(result, 2, clWhite);
  694. drawCircle(result, 20, false, clRed);
  695. except end;
  696. end;
  697. end;
  698. end;
  699.  
  700. function PtToHyp(I, C: TPoint): Integer;
  701. begin
  702. Result := Round(Hypot(I.X - C.X, I.Y - C.Y));
  703. end;
  704.  
  705. {---------------------------------------------------}
  706. {-----Determines if we're within the circle---------}
  707. {---------------------------------------------------}
  708. function WithinCircle(Cx, Cy, Ra: Integer; I: Tpoint): Boolean;
  709. var
  710. TP1: Tpoint;
  711. begin
  712. TP1 := point(Cx, Cy);
  713. if PtToHyp(I, TP1) < Ra then
  714. Result := True
  715. else
  716. Result := False;
  717. end;
  718.  
  719. {---------------------------------------------------}
  720. {------ Determines if we're within the box----------}
  721. {---------------------------------------------------}
  722. function WithInBox(SX, SY, EX, EY: Integer; I: Tpoint): Boolean;
  723. begin
  724. if (I.X > SX) and (I.X < EX) and (I.Y > SY) and (I.Y < EY) then
  725. Result := True
  726. else
  727. Result := False;
  728. end;
  729.  
  730. {---------------------------------------------------}
  731. {--------- Checks if the TPA is in bound------------}
  732. {---------------------------------------------------}
  733. function InBound(TestPoint: Tpoint): Boolean;
  734. begin
  735. if not (WithInBox(mainscreen.x1, mainscreen.y1, mainscreen.x2, mainscreen.y2, TestPoint)) or WithInCircle(15, 137, 10, TestPoint) or WithInCircle(485, 170, 30, TestPoint) or WithInBox(220, 85, 220, 215, TestPoint) or WithInBox(0, 0, 360, 20, TestPoint) then
  736. Result := False
  737. else
  738. Result := True;
  739. end;
  740.  
  741. {-------------------------------------------------}
  742. {--- Antiban -- Used just before walking north ---}
  743. {-------------------------------------------------}
  744. procedure Antiban();
  745. begin
  746. case random(310) of
  747. 1..60: begin
  748. pickUpMouse();
  749. wait(randomRange(175,1250));
  750. end;
  751. 61..150: begin
  752. smallRandomMouse();
  753. wait(randomRange(200,500));
  754. end;
  755. 150..214: begin
  756. mouseOffClient(OFF_CLIENT_RANDOM);
  757. wait(randomRange(5125,10510));
  758. end;
  759. 215..250: begin
  760. case random(4) of
  761. 1: hoverSkill(SKILL_ATTACK);
  762. 2: hoverSkill(SKILL_DEFENCE);
  763. 3: hoverSkill(SKILL_STRENGTH);
  764. 4: hoverRandomSkill();
  765. end;
  766. wait(randomRange(2000,7500));
  767. end;
  768. 251..310: begin
  769. sleepAndMoveMouse(2150 + random(2000));
  770. wait(randomRange(500,1250));
  771. end;
  772. end;
  773. end;
  774.  
  775. {-------------------------------------------------}
  776. {---Antiban / Walk into fighting area procedure---}
  777. {-------------------------------------------------}
  778. procedure actions();
  779. begin
  780. case random(500) of
  781. 1..89: Antiban();
  782. 90..500: WalkTo(LOCATION);
  783. end;
  784. end;
  785.  
  786. {-------------------------------------------------}
  787. {---- Re Log - Used for if we have been lured ----}
  788. {-------------------------------------------------}
  789. procedure reLog();
  790. begin
  791. case random(20) of
  792. 1..12: players[currentPlayer].exitToLobby();
  793. 13..20: begin
  794. mouseBox(intToBox(791, 1, 796, 8), MOUSE_LEFT);
  795. wait(randomRange(1000,2000));
  796. mouseBox(intToBox(279, 327, 387, 342), MOUSE_LEFT);
  797. end;
  798. end;
  799.  
  800. wait(randomRange(8000,15000));
  801. Lobby.quickSelectWorld(WORLD);
  802. wait(randomRange(8000,15000));
  803.  
  804. wait(randomRange(1000,2000));
  805. mainscreen.setAngle(MS_ANGLE_HIGH);
  806. wait(randomRange(1000,2000));
  807. minimap.setAngle(MM_DIRECTION_EAST);
  808. wait(randomRange(1000,2000));
  809.  
  810. mainscreen.setZoom(true);
  811. exitTreasure();
  812.  
  813. if checkPoll() then
  814. closePoll();
  815. end;
  816.  
  817. {-------------------------------------------------}
  818. {---Check if we're in combat (getting attacked)---}
  819. {-------------------------------------------------}
  820. function inCombat(): boolean;
  821. var
  822. adrenalineThen, adrenalineNow: integer;
  823. begin
  824. adrenalineThen := actionBar.getAdrenalinePercent();
  825. if adrenalineThen >= 70 then
  826. begin
  827. exit(true);
  828. end;
  829.  
  830. if adrenalineThen > 0 then
  831. begin
  832. wait(2000);
  833. adrenalineNow := actionBar.getAdrenalinePercent();
  834. if adrenalineThen < adrenalineNow then
  835. begin
  836. exit(true);
  837. end;
  838. end else
  839. begin
  840. exit(false);
  841. end;
  842. end;
  843. {---------------------------------------------------}
  844. {-----------Find and click white portal-------------}
  845. {---------------------------------------------------}
  846. procedure findPortal();
  847. Var
  848. PCol, AE, X, Y, PTol, I: Integer;
  849. TPA : TPointArray;
  850. ATPA : T2DPointArray;
  851. Begin
  852.  
  853.  
  854. If FindNorth() Then
  855. begin
  856. actions();
  857. exit;
  858. end;
  859.  
  860. If inSafe() then
  861. exit;
  862.  
  863. writeStatus('Finding portal.');
  864. minimap.setAngle(MM_DIRECTION_EAST);
  865. PCol := 1133920;
  866. PTol := 13;
  867.  
  868. If isMouseOverText(['safe)']) Then
  869. Begin
  870. writeStatus('Clicking portal.');
  871. Inc(deaths);
  872. fastClick(MOUSE_LEFT);
  873. wait(randomRange(5000,6000));
  874.  
  875. minimap.setAngle(MM_DIRECTION_EAST);
  876.  
  877. Exit;
  878. End;
  879.  
  880. inc(AE);
  881.  
  882. If FindColorsSpiralTolerance( X, Y, TPA, PCol, mainscreen.x1, mainscreen.y1, mainscreen.x2, mainscreen.y2, PTol) Then
  883. Begin
  884. SetLength( ATPA, 10);
  885. ATPA := TPAToATPAEx( TPA, 50, 30);
  886. For I := 0 To RandomRange( 0, High( ATPA)) Do
  887. Begin
  888. If GetColor( 48, 19)= 16777215 Then
  889. Begin
  890. Wait( Random( 1000));
  891. Exit;
  892. End;
  893. Mouse(MiddleTPA(ATPA[I]), 2);
  894. Wait( 10 + Random( 90));
  895. writeStatus('Finding portal.');
  896. If isMouseOverText(['safe)']) Then
  897. Begin
  898. writeStatus('Clicking portal.');
  899. Inc(deaths);
  900. Mouse(MiddleTPA(ATPA[I]), 1);
  901. wait(randomRange(5000,6000));
  902. minimap.setAngle(MM_DIRECTION_EAST);
  903. Exit;
  904. End;
  905. If AE > RandomRange( 3, 4) Then
  906. case Random(75) of
  907. 0..25: minimap.clickCompass;
  908. 26..50: minimap.setAngle(random(0, 60));
  909. end;
  910. End;
  911. End;
  912. end;
  913.  
  914. procedure NewNS();
  915. var
  916. x, y, i, ii: integer;
  917. TPA: TPointArray;
  918. ATPA: T2DPointArray;
  919. COLORS: TIntegerArray;
  920. begin
  921. writeStatus('Finding player.');
  922.  
  923. { COLORS := [8087871, 12296544, 9338696, 6970934, 10520914, 6178891, 11623524, 9062253,
  924. 14189656, 5256233, 7461497, 3169844, 7884087, 8213568, 6378290,
  925. 6510898, 8919673, 8996735, 9324676, 8546883, 12557154, 13593459,
  926. 7552069, 5261097, 12411497, 8919929, 5975624, 10979158, 612872,
  927. 11836253, 7622203, 5456683, 16528616, 5322281, 9009990, 6766121,
  928. 1918492, 8153663]; }
  929.  
  930. COLORS := [8087871, 6974068, 16528616, 3945247, 756024, 2045032,
  931. 8875589, 2099568, 10704002, 12674211, 12493665, 11556168,
  932. 10510401, 12427872, 2236966, 11176279, 1624831, 11149974,
  933. 14137198, 11162973, 13025298, 875684, 10050622,
  934. 1287141, 5160182, 10062160, 16118296];
  935.  
  936. if inCombat() or FindNorth() or not inSafe() then
  937. exit;
  938.  
  939. if (chooseOption.isOpen()) then
  940. chooseOption.close();
  941.  
  942. for i := 0 to high(COLORS) do
  943. begin
  944. writeStatus('Finding player.');
  945.  
  946. Wait( 100 + random(100) );
  947. if inCombat() or findNorth() or not inSafe() then
  948. exit;
  949.  
  950. if (chooseOption.isOpen()) then
  951. chooseOption.close();
  952.  
  953. findColorsSpiralTolerance(x, y, TPA, COLORS[i], mainScreen.getBounds(), 3, colorSetting(2, 0.25, 0.84));
  954. writeStatus('Finding player.');
  955.  
  956. ATPA := TPA.toATPA(30, 30);
  957. ATPA.sortFromMidPoint(mainscreen.playerPoint);
  958. smartImage.debugATPA(ATPA);
  959.  
  960. if high(ATPA) < 1 OR high(ATPA) = 0 then exit();
  961.  
  962. if limit > high(ATPA) then
  963. begin
  964. limit := high(ATPA);
  965. end;
  966.  
  967. for ii := 0 to limit do
  968. begin
  969. Wait( 100 + random(100) );
  970. if inCombat() or findNorth() or not inSafe() then
  971. exit;
  972.  
  973. if (chooseOption.isOpen()) then
  974. chooseOption.close();
  975.  
  976. writeStatus('Right clicking color.');
  977.  
  978. mouse(middleTPA(ATPA[ii]), MOUSE_RIGHT);
  979. smartImage.clearArea(mainscreen.getBounds());
  980.  
  981. if (chooseOption.isOpen()) then
  982. begin
  983. wait(RandomRange(100,200));
  984. if chooseOption.optionsExist(people) then
  985. begin
  986. smartImage.clearArea(mainscreen.getBounds());
  987. writeStatus('Attacking a NS.');
  988.  
  989. Wait( 100 + Random( 500));
  990. chooseOption.select(people);
  991.  
  992. if not prayersOn() and inCombat() and PRAYERS = 1 then
  993. begin
  994. case random(20) of
  995. 1..9: togglePrayer();
  996. end;
  997. smallRandommouse();
  998. end;
  999. writeStatus('Attacking a NS.');
  1000. wait(randomRange(1200,1500));
  1001.  
  1002. exit;
  1003. end else
  1004. begin
  1005. writeStatus('Closing choose option screen.');
  1006.  
  1007. chooseOption.close();
  1008. end;
  1009. end;
  1010. end;
  1011. end;
  1012. end;
  1013.  
  1014. procedure mainLoop();
  1015. begin
  1016. if not isLoggedIn() or lobby.isOpen() then
  1017. declarePlayers();
  1018.  
  1019.  
  1020. if ((ATTACK=1) and not inCombat() and not findNorth() and inSafe()) then
  1021. begin
  1022. writeStatus('Searching for player.');
  1023. NewNS();
  1024. end;
  1025.  
  1026.  
  1027. if (LOCATION='NORMAL') and not inCombat() and not findNorth() and inMulti() then reLog();
  1028. if (LOCATION='NORMAL') and not inCombat() and not findNorth() and findWest() then reLog();
  1029. if (LOCATION='NORMAL') and not inCombat() and not findNorth() and findEast() then reLog();
  1030.  
  1031. if (LOCATION='REST') and not inCombat() and not findNorth() and inMulti() then reLog();
  1032. if (LOCATION='REST') and not inCombat() and not findNorth() and findWest() then reLog();
  1033. if (LOCATION='REST') and not inCombat() and not findNorth() and findEast() then reLog();
  1034.  
  1035. if inSafe() then
  1036. begin
  1037. if actionbar.getAdrenalinePercent() > 49 then
  1038. SendKeys('7', 15+RandomRange(15,100), 20+RandomRange(10,30));
  1039.  
  1040. if actionbar.getAdrenalinePercent() > 99 then
  1041. SendKeys('8', 15+RandomRange(15,100), 20+RandomRange(10,30));
  1042. end;
  1043.  
  1044. if checkExamine() then
  1045. closeExamine();
  1046.  
  1047. {case random(100) of
  1048. 1: if (LOCATION='NORMAL') then antiLure();
  1049. end;
  1050.  
  1051. if (LOCATION='HILLS') then antiLureHills();
  1052.  
  1053. if inMulti() then
  1054. begin
  1055. if (LOCATION='HILLS') then exit();
  1056. if (LOCATION='POND') then exit();
  1057. Inc(lures);
  1058. reLog();
  1059. exit();
  1060. end; }
  1061.  
  1062. case random(1000) of
  1063. 1..75: begin
  1064. randomMouseSpeed(3, 10, 20);
  1065. writeStatus('Changed mouse speed.');
  1066. end;
  1067. end;
  1068.  
  1069. if (checkVex) then
  1070. begin
  1071. WriteStatus('Closing clan vex.');
  1072. closeVex();
  1073. end;
  1074.  
  1075. if (checkRed) then
  1076. begin
  1077. WriteStatus('Closing warning.');
  1078. closeRed();
  1079. end;
  1080.  
  1081. if ((talked=1)) and inCombat() then
  1082. begin
  1083. case random(1100) of
  1084. 34..94: Talk();
  1085. end;
  1086. end;
  1087.  
  1088. if not inSafe() then
  1089. begin
  1090. repeat
  1091. writeStatus('Finding portal.');
  1092. findPortal();
  1093. until (findNorth() OR inSafe() or checkRed() or CheckVex());
  1094.  
  1095. end else
  1096. begin
  1097. if findNorth() then
  1098. begin
  1099. actions();
  1100. end;
  1101. end;
  1102. randnum := random(55212);
  1103. if (randnum < 80) AND not inCombat() then
  1104. begin
  1105. case randnum of
  1106. 12..20: begin
  1107. sleepAndMoveMouse(1000 + random(2000));
  1108. writeLn('Random was 12-20.');
  1109. end;
  1110. 34..42: begin
  1111. pickUpMouse();
  1112. writeLn('Random was 34-42.');
  1113. end;
  1114. 51..59: begin
  1115. smallRandomMouse();
  1116. writeLn('Random was 51-59.');
  1117. end;
  1118. 71..72: begin
  1119. mouseBox(intToBox(235, 150, 360, 260), MOUSE_LEFT);
  1120. writeLn('Random was 71-72.');
  1121. end;
  1122. end;
  1123. end;
  1124. end;
  1125.  
  1126. begin
  1127. smartShowConsole := FALSE;
  1128. smartEnableDrawing := TRUE;
  1129.  
  1130. setupSRL();
  1131.  
  1132. if not isLoggedIn() or lobby.isOpen() then
  1133. declarePlayers();
  1134.  
  1135. writeStatus('Initiated Ns Bot.');
  1136.  
  1137. xpthen := chatbox.getXPBar();
  1138. clearDebug();
  1139. repeat
  1140. smartImage.clearArea(mainscreen.getBounds());
  1141. mainloop();
  1142. if checkVex() then
  1143. begin
  1144. WriteStatus('Closing clan vex.');
  1145. closeVex();
  1146. end;
  1147. if checkRed() then
  1148. begin
  1149. WriteStatus('Closing warning.');
  1150. closeRed();
  1151. end;
  1152. if (chooseOption.isOpen()) then
  1153. chooseOption.close();
  1154. until (false);
  1155. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement