Untitled


SUBMITTED BY: Guest

DATE: June 8, 2013, 2:29 p.m.

FORMAT: Text only

SIZE: 21.2 kB

HITS: 1383

  1. // Simba script, go here if u need help http://villavu.com/forum/showthread.php?t=103209 //
  2. // *-- Script by: Ryutoh --* //
  3. // *-- 5/24/2013 --* //
  4. // *-- Barrows Fighter V1 --* //
  5. // //
  6. program barrowsfighter;
  7. {$DEFINE SMART}
  8. {$I SRL-OSR/SRL.Simba}
  9. {$i SRL-OSR\SRL\misc\SmartGraphics.simba}
  10. //Please fill in the configuration below.
  11. //*I also recommend that you kill the barrows brothers before starting
  12. const
  13. //Email or Username
  14. username = '';
  15. //Password
  16. password = '';
  17. //HP to eat food at
  18. hpToEat = 60;
  19. //Teleport out when out of food or if hp drops too low? (Use any teletab)
  20. teleportOut = 'false'; //(True/False)
  21. //HP to teleport out at if almost dead?
  22. hpToTeleAt = 15;
  23. //Avalible pre-set food types: trout, salmon, tuna, lobster, monkfish, shark.
  24. foodName = 'shark'; //*Recommend monkfish or sharks.
  25. //1 top left box, 2 top right, 3 bottom left, 4 bottom right
  26. trainingmode = 2;
  27. //Spec weapons avalible: excalibur, dba(dragon battle axe)
  28. specWeapon = 'excalibur'; //Leave empty if none
  29. //If you're using spec, fill in main weapon info
  30. mainWeaponName = 'cimitar'; //Use short part of weapon name
  31. mainWepColor1 = 858228; //Color info
  32. mainWepColor2 = 858748;
  33. //Only right click monsters? Might prevent misclicks of opening doors
  34. //but averages about 3 - 5k less exp/hour
  35. rightClickOnly = 'false'; //(True/False)
  36. //How fast to move the mouse?
  37. customMouseSpeed = 16; //1-10 slow, 11-20 med, 20+ very fast
  38. //Use a faster but less accurate method of fighting?
  39. //Can improve exp rates by about 3 - 5k exp/hour
  40. //(Works best with fast attacking weapons)
  41. newFightMethod = 'true'; //(True/False)
  42. //////////////////////////////////////////////////////////////////
  43. var
  44. X, Y, T, Clicked, teletab, skillwindow, changeSpecTime, blueHitSplat, redHitSplat, dbaDTM, KC, KillsPerHour, TimeGone, lost, totalExp, hitcount, counter, excalDTM : integer;
  45. detectHitSplat : boolean;
  46. npcToKill : string;
  47. procedure declarePlayers;
  48. begin
  49. HowManyPlayers := 1;
  50. NumberOfPlayers(HowManyPlayers);
  51. CurrentPlayer := 0;
  52. with Players[0] do
  53. begin
  54. Name := username;
  55. Pass := password;
  56. Active := True;
  57. end;
  58. end;
  59. procedure proggy;
  60. begin
  61. if not (KC < 1) then
  62. begin
  63. SMART_ClearCanvas;
  64. TimeGone := GetTimeRunning / 1000;
  65. KillsPerHour := 3600 * KC / TimeGone;
  66. SMART_DrawText(8, 23, LoginChars, 'Barrows Fighter by Ryutoh', clwhite);
  67. SMART_DrawText(8, 40, UpChars07, 'Kills per hour around:', clwhite);
  68. SMART_DrawText(154, 40, UpChars07, '' + IntToStr(KillsPerHour) + ', or ' + IntToStr(KillsPerHour * 180) +' experience/hr', clyellow);
  69. if (specWeapon = 'excalibur') or (specWeapon = 'dba') then
  70. begin
  71. SMART_DrawText(8, 54, UpChars07, 'Spec timer: ', clwhite);
  72. SMART_DrawText(87, 54, UpChars07, '' + inttostr(TimeFromMark(T) / 1000) + ' / ' + IntToStr(changeSpecTime / 1000) + ' seconds.', clyellow);
  73. end
  74. end else
  75. exit;
  76. end;
  77. procedure findMonster;
  78. begin
  79. writeln('Monsters lost, looking around.');
  80. if lost > 10 then
  81. begin
  82. sleep(7000 + random(4000));
  83. logout;
  84. if (LoggedIn) then
  85. begin
  86. RunAway('e', True, 2, 3000);
  87. sleep(3000 + random(1000))
  88. logout;
  89. end;
  90. writeln('Unable to find monsters after 10 tries, logging out.');
  91. writeln('Ran for: ' + TimeRunning);
  92. totalExp := KC * 180;
  93. writeln('Killcount: ' + IntToStr(KC) + ', thats ' + IntToStr(totalExp) + ' experience!');
  94. terminatescript;
  95. end else
  96. begin
  97. writeln('No monsters found, spinning.');
  98. SetAngle(SRL_ANGLE_HIGH);
  99. makecompass(randomrange(0, 360))
  100. wait(200 + random(300))
  101. Inc(lost)
  102. end;
  103. end;
  104. procedure spec;
  105. begin
  106. if (specWeapon = 'excalibur') or (specWeapon = 'dba') then
  107. begin
  108. excalDTM := DTMFromString('mWAAAAHicY2FgYEhlYmDIB+JsIM4B4k9AsUdA/ACIHzOAACMc9zY3MyADLhRZCAYBAKQ4BvM=');
  109. dbaDTM := DTMFromString('mggAAAHicY2NgYFADYikglgRiHiAWA2IZIE4C4kAgdgPiICAOBmJfBhBgxMAFEjwMXEAWOpbEqhqCIQAAKTMDcw==');
  110. if (TimeFromMark(T) >= changeSpecTime) then
  111. begin
  112. gametab(tab_inv)
  113. writeln('Time for spec!')
  114. case (specWeapon) of
  115. 'excalibur':
  116. if FindDTM(excalDTM, X, Y, MIX1, MIY1, MIX2, MIY2) then
  117. begin
  118. MarkTime(T)
  119. Mouse(X + random(2), Y + random(2), 2, 2, 1);
  120. wait(500 + random(300))
  121. end;
  122. 'dba':
  123. if FindDTM(dbaDTM, X, Y, MIX1, MIY1, MIX2, MIY2) then
  124. begin
  125. MarkTime(T)
  126. Mouse(X + random(2), Y + random(2), 2, 2, 1);
  127. wait(500 + random(300))
  128. end;
  129. end;
  130. gametab(tab_Combat)
  131. wait(300)
  132. if FindColorTolerance(X, Y, 4229183, 700, 417, 712, 427, 20) then
  133. begin
  134. wait(100)
  135. Mouse(647 + random(2), 423 + random(2), 2, 2, 1);
  136. wait(200 + random(100))
  137. changeSpecTime := 340000 + random(40000);
  138. end else
  139. begin
  140. writeln('Not ready for spec yet, waiting longer.')
  141. changeSpecTime := 60000;
  142. end;
  143. gametab(tab_inv)
  144. wait(500)
  145. if FindObjEx(X, Y, ['ield', mainWeaponName], [mainWepColor1, mainWepColor2], 12, 50, MIX1, MIY1, MIX2, MIY2) then
  146. begin
  147. writeln('Wielding main weapon back.')
  148. Mouse(X + random(2), Y + random(2), 2, 2, 1);
  149. end else
  150. begin
  151. writeln('Something is wrong with main weapon color or name.')
  152. writeln('Please fix this, or dont use spec.')
  153. sleep(15000)
  154. terminatescript;
  155. end
  156. end;
  157. FreeDTM(excalDTM)
  158. FreeDTM(dbaDTM)
  159. end
  160. end;
  161. Function attackLeft : boolean;
  162. var
  163. MonsterTPA, GreenHpTPA : TPointArray;
  164. MonsterATPA : T2DPointArray;
  165. MonsterBox : TBox;
  166. r, i : integer;
  167. begin
  168. case (npcToKill) of
  169. 'bloodworms':
  170. begin
  171. if not FindObjEx(X, Y, ['ttak', 'loodwor'], [1000804, 4103847, 674403, 1206922, 1144980, 1596800], 12, 50, MSX1, MSY1, MSX2, MSY2) then
  172. begin
  173. findMonster;
  174. exit;
  175. end
  176. end;
  177. 'rats': //Not done yet
  178. begin
  179. if FindColorsTolerance(MonsterTPA, 7178348, MSX1, MSY1, MSX2, MSY2, 10) then
  180. begin
  181. MonsterATPA := SplitTPAEx(MonsterTPA, 10, 10);
  182. SortATPASize(MonsterATPA, True);
  183. for i := 0 to high(MonsterATPA) do
  184. begin
  185. MonsterBox := GetTPABounds(MonsterATPA[i]);
  186. if not FindColor(X, Y, 255, MonsterTPA[i].x-12, MonsterTPA[i].y-17, MonsterTPA[i].x+12, MonsterTPA[i].y+17) or not FindColor(X, Y, 65280, MonsterTPA[i].x-12, MonsterTPA[i].y-17, MonsterTPA[i].x+12, MonsterTPA[i].y+17) THEN
  187. writeln('hp box not found');
  188. if i = high(MonsterATPA) then
  189. begin
  190. writeln('None found');
  191. end;
  192. end;
  193. r := random(length(MonsterTPA));
  194. end else
  195. begin
  196. findMonster;
  197. exit;
  198. end
  199. end;
  200. 'skeletons':
  201. begin
  202. end;
  203. end;
  204. Clicked := DTMFromString('mWAAAAHicY2FgYNBhZGAwhWIQ+xgDBJ+H4v9oGB0womEQAAC5ewf1');
  205. writeln('Monster found at: ' + IntToStr(x) + ', ' + IntToStr(y));
  206. if not IsUpText('oor') then
  207. begin
  208. ClickMouse(X, Y, mouse_left);
  209. wait(50);
  210. if FindDTM(Clicked, X, Y, MSX1, MSY1, MSX2, MSY2) then
  211. begin
  212. makecompass(randomrange(0, 360))
  213. wait(2500 + random(1050))
  214. Inc(KC)
  215. lost := 0;
  216. FreeDTM(Clicked);
  217. end else
  218. begin
  219. writeln('Miss clicked, attempting to click again.');
  220. wait(250 + random(50))
  221. FreeDTM(Clicked);
  222. attackLeft;
  223. end;
  224. end else
  225. attackLeft;
  226. end;
  227. procedure attackRight;
  228. begin
  229. case (npcToKill) of
  230. 'bloodworms':
  231. begin
  232. if not FindObjEx(X, Y, ['ttak', 'loodwor'], [1000804, 4103847, 674403, 1206922, 1144980, 1596800], 12, 50, MSX1, MSY1, MSX2, MSY2) then
  233. begin
  234. findMonster;
  235. exit;
  236. end;
  237. end;
  238. 'rats':
  239. begin
  240. if not FindObjEx(X, Y, ['ttak', 'iant', 'rypt', 'at'], [8358276, 6975078, 8358271, 6058844, 7244398, 6190685, 7371120, 9278344, 5136973, 4738632], 3, 50, MSX1, MSY1, MSX2, MSY2) then
  241. begin
  242. findMonster;
  243. exit;
  244. end;
  245. end;
  246. 'skeletons':
  247. begin
  248. end;
  249. end;
  250. ClickMouse(X, Y, mouse_right);
  251. wait(200+random(100));
  252. if ChooseOptionMulti(['tta']) then
  253. begin
  254. ChooseOptionMulti(['tta']);
  255. makecompass(randomrange(0, 360))
  256. wait(2500 + random(1050))
  257. Inc(KC)
  258. lost := 0;
  259. end else
  260. begin
  261. writeln('Miss clicked, attempting to click again.');
  262. attackRight;
  263. end
  264. end;
  265. procedure attackMonster;
  266. begin
  267. if not LoggedIn then LoginPlayer;
  268. if (rightClickOnly = 'true') then
  269. begin
  270. attackRight;
  271. end else
  272. begin
  273. case random(5) of
  274. 0..3 : begin attackLeft; end;
  275. 4 : begin attackLeft; end; //right
  276. end
  277. end
  278. end;
  279. procedure antiBan;
  280. begin
  281. case random(160) of
  282. 0..20: begin hoverskill(skill_strength, false) sleep(random(300)) end;
  283. 21..30: begin hoverskill(skill_hitpoints, false) sleep(random(300)) end;
  284. 31..40: begin hoverskill(skill_attack, false) sleep(random(300)) end;
  285. 41..50: begin hoverskill(skill_defence, false) sleep(random(300)) end;
  286. 51..53: begin hoverskill(skill_range, false) sleep(random(300)) end;
  287. 54..56: begin hoverskill(skill_prayer, false) sleep(random(300)) end;
  288. 57: begin hoverskill(skill_slayer, false) sleep(random(300)) end;
  289. 58: begin hoverskill(skill_woodcutting, false) sleep(random(300)) end;
  290. 59: begin hoverskill(skill_cooking, false) sleep(random(300)) end;
  291. 60: begin hoverskill(skill_fishing, false) sleep(random(300)) end;
  292. 61: begin hoverskill(skill_firemaking, false) sleep(random(300)) end;
  293. 62: begin hoverskill(skill_mining, false) sleep(random(300)) end;
  294. 63..65: begin HoverOnlineFriend; sleep(100 + random(100)) end;
  295. 66:
  296. begin
  297. case random(3) of
  298. 1:
  299. begin
  300. writeln('Taking short 20 - 50 second break.');
  301. wait(20000 + random(30000))
  302. end;
  303. end
  304. end;
  305. //67: begin adjustmousespeed(2, 10, 20) sleep(random(300)) end;
  306. 67..69: begin randomRClick; sleep(random(300)) end;
  307. 70..71: begin hovermovingobject; sleep(random(300)) end;
  308. 72..75: begin MMouseOffClient('top'); sleep(random(300)) end;
  309. 76..79: begin MMouseOffClient('left'); sleep(random(300)) end;
  310. 80..83: begin MMouseOffClient('right'); sleep(random(300)) end;
  311. 84..87:begin MMouseOffClient('bottom'); sleep(random(300)) end;
  312. 88..89:
  313. begin
  314. if FindObjEx(X, Y, ['ttak', 'loodwor'], [1000804, 4103847, 674403, 1206922, 1144980, 1596800], 8, 50, MSX1, MSY1, MSX2, MSY2) then
  315. Mouse(X, Y, 5, 5, 0);
  316. wait(500 + random(500))
  317. ChooseOptionMulti(['xamine']);
  318. sleep(random(100))
  319. end;
  320. 90..100: begin RandomTab(True); makecompass(randomrange(0, 360)) wait(500 + random(300)) end;
  321. 101..110: begin RandomMovement; sleep(random(500)) end;
  322. 111..145: begin makecompass(randomrange(0, 360)) wait(300 + random(100)) end;
  323. 146..147: begin BoredHuman; end;
  324. 148: begin ExamineInv; end;
  325. 149: begin RandomFKeys(True); end;
  326. 150: begin DragRandomInvSlot; end;
  327. 151..160: begin makecompass(randomrange(0, 360)) wait(300 + random(300)) end;
  328. end
  329. end;
  330. procedure terminate(logoutMessage:string);
  331. begin
  332. if (logoutMessage = 'food') then
  333. begin
  334. writeln('No food found, attempting to logout.');
  335. end
  336. else if (logoutMessage = 'teletab') then
  337. begin
  338. writeln('Low hp found, attempting to logout.');
  339. end;
  340. sleep(7000 + random(4000))
  341. logout;
  342. if (LoggedIn) then
  343. begin
  344. RunAway('e', True, 2, 3000);
  345. sleep(3000 + random(1000))
  346. logout;
  347. end;
  348. writeln('Ran for: ' + TimeRunning);
  349. totalExp := KC * 180;
  350. writeln('Killcount: ' + IntToStr(KC) + ', thats ' + IntToStr(totalExp) + ' experience!');
  351. terminatescript;
  352. end;
  353. procedure teleport;
  354. begin
  355. gametab(tab_inv)
  356. wait(300 + random (200))
  357. if gametab(tab_inv) then
  358. begin
  359. teletab := DTMFromString('mlwAAAHicY2dgYLBnYmDwA+IAKO0IxGZAbArE14Hyt4D4CRB/AOJPUPopAwgw4sG4ARG6AKj+CEc=');
  360. if FindDTM(teletab, X, Y, MIX1, MIY1, MIX2, MIY2) then
  361. begin
  362. writeln('Teleporting.');
  363. MouseBox(X, Y, X, Y, mouse_right);
  364. if ChooseOptionMulti(['rea']) then
  365. begin
  366. ChooseOptionMulti(['rea'])
  367. wait(500)
  368. FreeDTM(teletab);
  369. end else
  370. FreeDTM(teletab);
  371. teleport;
  372. end else
  373. writeln('No teletab found.');
  374. end
  375. end;
  376. procedure checkHealth;
  377. begin
  378. if GetSkillInfo('hitpoints', true) <= hpToTeleAt then
  379. begin
  380. if (teleportOut = 'true') then
  381. begin
  382. teleport;
  383. terminate('teletab')
  384. end
  385. end;
  386. if GetSkillInfo('hitpoints', true) > hpToEat then
  387. begin
  388. case random(6) of
  389. 0:
  390. begin
  391. writeln('Random antiban.');
  392. antiBan;
  393. end;
  394. end
  395. end else
  396. begin
  397. gametab(tab_inv)
  398. wait(300 + random (200))
  399. if gametab(tab_inv) then
  400. begin
  401. case (foodName) of
  402. 'trout':
  403. if FindObjEx(X, Y, ['at', 'rout'], [7304076, 8949164, 5593195], 10, 50, MIX1, MIY1, MIX2, MIY2) THEN
  404. begin
  405. writeln('Eatting trout.');
  406. MouseBox(X + 3, Y + 3, X + 3, Y + 3, mouse_left);
  407. sleep(2000 + random(500))
  408. end else
  409. begin
  410. if (teleportOut = 'true') then
  411. begin
  412. teleport;
  413. end;
  414. terminate('food');
  415. end;
  416. 'salmon':
  417. if FindObjEx(X, Y, ['at', 'almon'], [1459962, 6912203, 864166], 10, 50, MIX1, MIY1, MIX2, MIY2) THEN
  418. begin
  419. writeln('Eatting salmon.');
  420. MouseBox(X + 3, Y + 3, X + 3, Y + 3, mouse_left);
  421. sleep(2000 + random(500))
  422. end else
  423. begin
  424. if (teleportOut = 'true') then
  425. begin
  426. teleport;
  427. end;
  428. terminate('food');
  429. end;
  430. 'tuna':
  431. if FindObjEx(X, Y, ['at', 'una'], [7238282, 8686246, 5527401], 10, 50, MIX1, MIY1, MIX2, MIY2) THEN
  432. begin
  433. writeln('Eatting tuna.');
  434. MouseBox(X + 3, Y + 3, X + 3, Y + 3, mouse_left);
  435. sleep(2000 + random(500))
  436. end else
  437. begin
  438. if (teleportOut = 'true') then
  439. begin
  440. teleport;
  441. end;
  442. terminate('food');
  443. end;
  444. 'lobster':
  445. if FindObjEx(X, Y, ['at', 'obster'], [1664960, 1467065, 1200019], 10, 50, MIX1, MIY1, MIX2, MIY2) THEN
  446. begin
  447. writeln('Eatting lobster.');
  448. MouseBox(X + 3, Y + 3, X + 3, Y + 3, mouse_left);
  449. sleep(2000 + random(500))
  450. end else
  451. begin
  452. if (teleportOut = 'true') then
  453. begin
  454. teleport;
  455. end;
  456. terminate('food');
  457. end;
  458. 'monkfish':
  459. if FindObjEx(X, Y, ['at', 'onkfish'], [4478822, 2436663, 3293259], 10, 50, MIX1, MIY1, MIX2, MIY2) THEN
  460. begin
  461. writeln('Eatting monkfish.');
  462. MouseBox(X + 3, Y + 3, X + 3, Y + 3, mouse_left);
  463. sleep(2000 + random(500))
  464. end else
  465. begin
  466. if (teleportOut = 'true') then
  467. begin
  468. teleport;
  469. end;
  470. terminate('food');
  471. end;
  472. 'shark':
  473. if FindObjEx(X, Y, ['at', 'hark'], [5860483, 7375014, 6584980], 10, 50, MIX1, MIY1, MIX2, MIY2) THEN
  474. begin
  475. writeln('Eatting shark.');
  476. MouseBox(X + 3, Y + 3, X + 3, Y + 3, mouse_left);
  477. sleep(2000 + random(500))
  478. end else
  479. begin
  480. if (teleportOut = 'true') then
  481. begin
  482. teleport;
  483. end;
  484. terminate('food');
  485. end;
  486. end;
  487. end;
  488. end;
  489. end;
  490. procedure isInCombat;
  491. begin
  492. if newFightMethod = ('true') then
  493. begin
  494. repeat
  495. blueHitSplat := DTMFromString('mQwAAAHicY2ZgYOBkZGBgAeL/QPZuID4JxHuAmJm1FI6RASMSBgIA1cUEzA==');
  496. redHitSplat := DTMFromString('mQwAAAHicY2ZgYPgIxC+A+B0QrwHidUC8C4izGRnhGBkwImEgAAAzRQYp');
  497. if FindDTM(blueHitSplat, X, Y, 179, 126, 345, 255) or FindDTM(redHitSplat, X, Y, 179, 126, 345, 255) THEN
  498. begin
  499. Inc(hitcount)
  500. Inc(counter)
  501. //writeln('combat: true '+inttostr(counter)+'');//checking for combat
  502. detectHitSplat := true;
  503. wait(200)
  504. FreeDTM(blueHitSplat)
  505. FreeDTM(redHitSplat)
  506. end else
  507. begin
  508. Inc(hitcount)
  509. Dec(counter)
  510. wait(200)
  511. //writeln('combat: false '+inttostr(counter)+'');//checking for combat
  512. FreeDTM(blueHitSplat)
  513. FreeDTM(redHitSplat)
  514. end;
  515. until(hitcount = 4)
  516. if not (counter <= -1) then
  517. begin
  518. proggy;
  519. checkHealth;
  520. wait(700 + random(300))
  521. end else if (counter <= -1) then
  522. begin
  523. attackmonster;
  524. end;
  525. detectHitSplat := false;
  526. hitcount := 0;
  527. counter := 0;
  528. end else
  529. if FindColor(X, Y, 255, 213, 117, 305, 185) or FindColor(X, Y, 65280, 213, 117, 305, 185) THEN
  530. begin
  531. proggy;
  532. checkHealth;
  533. wait(1200 + random(500))
  534. end else
  535. begin
  536. attackmonster;
  537. end;
  538. end;
  539. procedure failsafes;
  540. begin
  541. skillwindow := DTMFromString('mWAAAAHicY2FgYHjByMDwF4pBbG6gmDwDgn6wowoFowNGNAwCALUWDHM=');
  542. if FindDTM(skillwindow, X, Y, MSX1, MSY1, MSX2, MSY2) then
  543. begin
  544. writeln('Skill window found open, attempting to close.');
  545. MouseBox(X + 3, Y + 3, X + 3, Y + 3, mouse_left);
  546. FreeDTM(skillwindow)
  547. end;
  548. FreeDTM(skillwindow)
  549. end;
  550. begin
  551. declarePlayers;
  552. SetupSRL();
  553. ActivateClient;
  554. writeln('Barrows Fighter by Ryutoh')
  555. writeln('Currently V1, please report bugs and errors on forum.')
  556. MarkTime(T)
  557. changeSpecTime := 1;
  558. npcToKill := 'bloodworms'; //Still not complete, keep as bloodworms
  559. repeat
  560. if (not LoggedIn) then
  561. begin
  562. writeln('Logging player in.');
  563. LogInPlayer;
  564. setangle(0)
  565. setrun(true)
  566. setfightmode(trainingmode)
  567. gametab(tab_stats)
  568. writeln('Starting.');
  569. MouseSpeed := customMouseSpeed;
  570. end;
  571. if (LoggedIn) then
  572. begin
  573. failsafes;
  574. spec;
  575. isInCombat;
  576. end;
  577. until(false)
  578. end.

comments powered by Disqus