Advertisement
Guest User

Untitled

a guest
Feb 15th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 60.21 KB | None | 0 0
  1. program autoFighter;
  2.  
  3. {$I SRL/SRL.Simba}
  4. {$i SRL/srl/misc/debug.simba}
  5. Const
  6. VERSION = 3.02;
  7. Disp = '3.02';
  8.  
  9. type groundObjects = record
  10. Color, tol, filter, width, height, textBMP, amount:Integer;
  11. hmod, smod:Extended;
  12. name, odds, value:string;
  13. end;
  14.  
  15. type NPCS = record
  16. Color, tol, filter, width, height, textBMP, killed, XP, Combat, Health:Integer;
  17. hmod, smod:Extended;
  18. name:string;
  19. RClick:Boolean;
  20. Drops:TIntegerArray;
  21. end;
  22.  
  23. type Foods = record
  24. name:string;
  25. bmp, used, heal, tol, cost:Integer;
  26. end;
  27.  
  28. type Pot = record
  29. color, tol, used, time, cost, timeout:Integer;
  30. hmod, smod:Extended;
  31. name, info:string;
  32. end;
  33.  
  34. type Prayers = record
  35. Location:TPoint;
  36. name, info:string;
  37. level:Integer;
  38. Exceptions:TIntegerArray;
  39. end;
  40.  
  41. type formInfo = record
  42. FightForm:Tform;
  43. Buttons: Array[0..3] of TButton;
  44. NPCButtons: Array[0..2] of TButton;
  45. LootButtons: Array[0..2] of TButton;
  46. PotionButtons: Array[0..1] of TButton;
  47. Edits:Array [0..1] of TEdit;
  48. Labels: Array[0..6] of TLabel;
  49. FoodInfo: Array [0..1] of TLabel;
  50. PotionInfo: Array[0..1] of TLabel;
  51. NPCInfo: Array[0..1] of TLabel;
  52. LootInfo: Array[0..2] of TLabel;
  53. LoginLabels: Array[0..1] of TLabel;
  54. Tabs: Array[0..6] of TTabSheet;
  55. Options:Array[0..4] of TListBox;
  56. Chosen:Array[0..4] of TListBox;
  57. NPCLabels:Array[0..2] of TLabel;
  58. GPanels:Array[0..1] of TPanel;
  59. PrayButtons: Array[0..1] of TButton;
  60. InfoLabels:Array[0..4] of TLabel;
  61. PrayLabels:Array [0..2] of TLabel;
  62. FoodButtons:Array[0..1] of TButton;
  63. CheckBoxes:Array[0..7] of TCheckBox;
  64. Shapes: Array[0..4] of Tshape;
  65. Trim: Array[0..6] of TShape;
  66. DropList:TListbox;
  67. TPage:TPageControl;
  68. PrayCombo:TComboBox;
  69. TimeOutEdit:TEdit;
  70. ClickDelay:TEdit;
  71. end;
  72.  
  73. var
  74. t, timeout, looted, casketBMP, praysDrank, waitclick, failsafe, failsafe_timeout:Integer;
  75. loot, debug, usecasket, usePrayer, keepPraying, ranout, useForm:boolean;
  76. usePots, keepPotting, useFood, pressed:Boolean;
  77. foodUse, potsUse, NPCKill, prayUse, LootItem:TIntegerArray;
  78. t_username, t_password, PrayPotType:string;
  79. groundObject: array [0..5] of groundObjects;
  80. NPC: array [0..3] of NPCS;
  81. Food: array [0..5] of Foods;
  82. Pots: array [0..7] of Pot;
  83. Prayer: array[0..29] of Prayers;
  84. FormData:FormInfo;
  85.  
  86. Procedure t_DeclarePlayers;
  87. begin
  88. t_username := 'hello world';
  89. t_password := '';
  90. useform := true;
  91. Loot := false;
  92. debug := false;
  93. usecasket := false;
  94. usePrayer := false;
  95. keepPraying := false;
  96. usePots := false;
  97. keepPotting := false;
  98. PrayPotType := 'pray';
  99. useFood := false;
  100. fooduse := [];
  101. potsUse := [];
  102. NPCKill := [];
  103. prayUse := [];
  104. lootItem := [];
  105. timeout := 19000;
  106. end;
  107.  
  108. function declareNPCs:Integer;
  109. begin
  110.  
  111. with Npc[0] do
  112. begin
  113. Color := 3949893;
  114. tol := 7;
  115. filter := 50;
  116. width := 40;
  117. height := 40;
  118. hmod := 0.00;
  119. smod := 0.13;
  120. XP := 12921;
  121. Health := 100;
  122. Combat := 20;
  123. textBMP := BitmapFromString(0, 0, 'null');
  124. RClick := false;
  125. Drops :=[0, 1, 2, 3, 4, 5]
  126. name := 'Rock crab';
  127. end;
  128.  
  129. with Npc[1] do
  130. begin
  131. Color := 7448542;
  132. tol := 10;
  133. filter := 60;
  134. width := 40;
  135. height := 70;
  136. hmod := 0.09;
  137. smod := 2.66;
  138. XP := 7920;
  139. Health := 350;
  140. Combat := 28;
  141. textBMP := BitmapFromString(0, 0, 'null');
  142. RClick := false;
  143. Drops :=[1]
  144. name := 'Hill gaint';
  145. end;
  146.  
  147. with Npc[2] do
  148. begin
  149. Color := 3625911;
  150. tol := 10;
  151. filter := 60;
  152. width := 40;
  153. height := 70;
  154. hmod := 0.12;
  155. smod := 1.44;
  156. XP := 12000;
  157. Health := 1110;
  158. Combat := 86;
  159. textBMP := BitmapFromString(0, 0, 'null');
  160. RClick := false;
  161. Drops :=[1, 4]
  162. name := 'Fire gaint';
  163. end;
  164.  
  165. with Npc[3] do
  166. begin
  167. Color := 8960470;
  168. tol := 8;
  169. filter := 60;
  170. width := 40;
  171. height := 70;
  172. hmod := 0.02;
  173. smod := 2.14;
  174. XP := 12000;
  175. Health := 1110;
  176. Combat := 53;
  177. textBMP := BitmapFromString(0, 0, 'null');
  178. RClick := false;
  179. Drops :=[1, 4]
  180. name := 'Ogre';
  181. end;
  182.  
  183. result := length(NPC);
  184. end;
  185.  
  186. function declareObjects:Integer;
  187. begin
  188.  
  189. with groundObject[0] do
  190. begin
  191. Color := 935263;
  192. tol := 3;
  193. filter := 40;
  194. width := 45;
  195. height := 45;
  196. hmod := 0.03;
  197. smod := 0.31;
  198. textBMP := BitmapFromString(67, 9, 'meJzVk7ENwCAMBBdJnyJLZMQ07MI' + 'ErJVEQrIQfj+2OyQXDjzoL29Kbcd58Sq1FYdM1/28fyUOJu7xONwR' + 'pHuenMsnXCeYxEDf0oJxXbakn/SjEhqGvUVHIrNAoMmlHlJITxLRI' + 'FqZA7H+PPcMs4MgiUT4dEUT4RqCHAJxphAdoRAsOegfLZ4Uf++hR7' + '18Djyp3esDukgt2Q==');
  199. name := 'casket';
  200. odds := 'Uncommon';
  201. value := '10000-50000';
  202. end;
  203.  
  204. with groundObject[1] do
  205. begin
  206. Color := 2144231;
  207. tol := 3;
  208. filter := 30;
  209. width := 40;
  210. height := 40;
  211. hmod := 0.02;
  212. smod := 1.99;
  213. textBMP := BitmapFromString(56, 7, 'meJybuuOYjLo2fjR1x7GpRCjDRA4' + 'T/gMRVdSjOQDiJDSHwblYxfH4Ao+9ECkiFQARVvdgZeNyPJ4Ax+UM' + 'ZHEi2XjCE9OduBIDnd1JRnjij/oBcSeRYUiheyiPd/zhjD8rYQYsV' + 'nE87gQAhnaXCQ==');
  214. name := 'coins';
  215. odds := 'Common';
  216. value := '1';
  217. end;
  218.  
  219. with groundObject[2] do
  220. begin
  221. Color := 10462821;
  222. tol := 15;
  223. filter := 10;
  224. width := 15;
  225. height := 15;
  226. hmod := 0.17;
  227. smod := 0.80;
  228. textBMP := BitmapFromString(71, 5, 'meJyTUdeWgaGpO47BEZogMgOPYmT' + 'kMOE/MkITx89G047VfGQ1WA1HczMmG5dPMT1LkuNJZeMxH5diZPdj' + 'egpT5eDxFBVjCn8KpNwj+FMg5Z4iMnZoEVNEmo8sCAATqnzk');
  229. name := 'blue charm';
  230. odds := 'Uncommon';
  231. value := '0';
  232. end;
  233.  
  234. with groundObject[3] do
  235. begin
  236. Color := 7705733;
  237. tol := 11;
  238. filter := 10;
  239. width := 15;
  240. height := 15;
  241. hmod := 0.08;
  242. smod := 0.07;
  243. textBMP := BitmapFromString(73, 4, 'meJybuuOYjLo2BE3dcWwqjIvJRhb' + 'BoxgZOUz4D0RwBoSNLIUpQjkb2YVoXEyPYPqLVK9h2o7pGJp6jYxY' + 'wypFideQETHiVPEakTFFlVgjVRyrGgDBwDkW');
  244. name := 'green charm';
  245. odds := 'Uncommon';
  246. value := '0';
  247. end;
  248.  
  249. with groundObject[4] do
  250. begin
  251. Color := 6981784;
  252. tol := 3;
  253. filter := 10;
  254. width := 15;
  255. height := 15;
  256. hmod := 0.18;
  257. smod := 3.46;
  258. textBMP := BitmapFromString(74, 5, 'meJybuuOYjLo2HE3dcQyO0ASRGXg' + 'UIyOHCf+BCKsUXBZNDVYupjKs5mCKYPUFVjYuL2P6GtOp+H1BKhtX' + 'AGIqnoo77jB9h6mSSN/hihTq+g5TkMK4w584h5DviIyvAfQdpmIAw' + '9mLjw==');
  259. name := 'gold charm';
  260. odds := 'Common';
  261. value := '0';
  262. end;
  263.  
  264. with groundObject[5] do
  265. begin
  266. Color := 4014466;
  267. tol := 5;
  268. filter := 10;
  269. width := 15;
  270. height := 15;
  271. hmod := 0.06;
  272. smod := 3.31;
  273. textBMP := BitmapFromString(71, 5, 'meJyTUdeWgaGpO47BEZogMgOPYmT' + 'kMOE/EOERx6oAIohHDbICZCmsgsjOw2Tj8immZ4n0FKZ7cHkZqywe' + 'u9AUILsf01OYKinxFB4n4fEUrhjB5SkyYgp/CqSRp/DrIslTRMYOk' + 'ZbS2lMA4/Z85A==');
  274. name := 'chrimson charm';
  275. odds := 'Rare';
  276. value := '0';
  277. end;
  278.  
  279. result := length(groundObject);
  280. end;
  281.  
  282. function declareFood: Integer;
  283. begin
  284.  
  285. with Food[0] do
  286. begin
  287. name := 'Trout';
  288. heal := 70;
  289. tol := 120;
  290. cost := 45;
  291. bmp := BitmapFromString(9, 6, 'meJw9jN0KglAQBh/QEJEQReWgRzTM' + '1PT4jxcSUfTUDSwIc7PzLWNdPNsJ3avyfB1ERRiXKqkT3Wa5OWWsK' + 'kyadfltKMrp/tiqZm+7ox/eSIF/Wcfla6YP0KEmb5zz+mMSqAGRM8' + 'Uq0IGneeGpwR8Bb0T0');
  292. end;
  293.  
  294. with Food[1] do
  295. begin
  296. name := 'Lobster';
  297. heal := 120;
  298. tol := 110;
  299. cost := 165;
  300. bmp := BitmapFromString(9, 4, 'meJyTjtstHbdX2LFZzHu6eMBCiZAV' + 'UlFbeXn5ZBIPyWVeFPWaKuo5ESguHrhYImy1VMwOmaSjMsnHJIKXA' + 'dUAEUg8aIlk+DrpuN2yKSfksq4wMTAAtUiGrQWKA5VJRm6Sjt8PFA' + 'QiAJg9IgE=');
  301. end;
  302.  
  303. with Food[2] do
  304. begin
  305. name := 'Shrimp';
  306. heal := 30;
  307. tol := 100;
  308. cost := 0;
  309. bmp := BitmapFromString(8, 4, 'meJyTqT8k03BYunq3VPlWyaJ14lkL' + 'ReImCAXVShSslixcK5G7TCx1lmj8ROGIdgGfEn6XdOHIDtGkqaIJk' + '4EiggGV/G45fE6pfA6Jgn7lQoHVQI0CngUgEcdkXttYJgYGAG8RHiQ=');
  310. end;
  311.  
  312. with Food[3] do
  313. begin
  314. name := 'Pizza';
  315. heal := 90;
  316. tol := 135;
  317. cost := 280;
  318. bmp := BitmapFromString(6, 4, 'meJxL65qR0j41sWViQtOEuPqe7u6J' + '6T2zUjunJ7VNBgrGN/YBBTN656SBlQEFgcoEJEpypyyGKAMKArlAB' + 'AAEniFr');
  319. end;
  320.  
  321. with Food[4] do
  322. begin
  323. name := 'Swordfish';
  324. heal := 140;
  325. tol := 130;
  326. cost := 250;
  327. bmp := BitmapFromString(10, 5, 'meJyLd4iKB6NUl4Qs95Q8z4wS39x' + 'kp7gQiwBHbbvygMLKwOLqoNLakPL60IrGsCogt8A7C6je39S7OaKm' + 'K6a5J661L75tQkJHe1Q9UA1QS45HWqxdBJDbEd2IpgBoTql/PtCi1' + 'si61Qnz4QqAshMTu4AMoAKgAwBUDz5D');
  328. end;
  329.  
  330. with Food[5] do
  331. begin
  332. name := 'Shark';
  333. heal := 200;
  334. tol := 130;
  335. cost := 1200;
  336. bmp := BitmapFromString(9, 5, 'meJwLy2wMy2yMyG4GosicViCKymsH' + 'IiA3NKMeKAUUic7viCvqSSidkFQxObV6OpANlDJwCoMgoGKgSGL5R' + 'KBUStVUuDgyAkoBEaY40EyglvS6WQBlCjOd');
  337. end;
  338.  
  339. result := length(Food);
  340. end;
  341.  
  342. function declarePots:Integer;
  343. begin
  344.  
  345. with Pots[0] do
  346. begin
  347. color := 10433329;
  348. tol := 10;
  349. hmod := 0.03;
  350. smod := 0.11;
  351. cost := 1000;
  352. timeout := 800000;
  353. name := 'Super Attack';
  354. info := 'Increases Attack level by 15%';
  355. end;
  356.  
  357. with Pots[1] do
  358. begin
  359. color := 9868958;
  360. tol := 12;
  361. hmod := 0.20;
  362. smod := 0.19;
  363. cost := 1000;
  364. timeout := 800000;
  365. name := 'Super Strength';
  366. info := 'Increases Strength level by 15%';
  367. end;
  368.  
  369. with Pots[2] do
  370. begin
  371. color := 3311009;
  372. tol := 10;
  373. hmod := 0.02;
  374. smod := 0.10;
  375. cost := 1000;
  376. timeout := 800000;
  377. name := 'Super Defense';
  378. info := 'Increases Defense level by 15%';
  379. end;
  380.  
  381. with Pots[3] do
  382. begin
  383. color := 11183412;
  384. tol := 8;
  385. hmod := 0.03;
  386. smod := 0.13;
  387. cost := 350;
  388. timeout := 600000;
  389. name := 'Attack Potion';
  390. info := 'Increases Attack level by 10%';
  391. end;
  392.  
  393. with Pots[4] do
  394. begin
  395. color := 3185307;
  396. tol := 11;
  397. hmod := 0.02;
  398. smod := 0.08;
  399. cost := 750;
  400. timeout := 600000;
  401. name := 'Strength Potion';
  402. info := 'Increases Strength level by 10%';
  403. end;
  404.  
  405. with Pots[5] do
  406. begin
  407. color := 3383089;
  408. tol := 10;
  409. hmod := 0.03;
  410. smod := 0.08;
  411. cost := 550;
  412. timeout := 600000;
  413. name := 'Defense Potion';
  414. info := 'Increases Defense level by 10%';
  415. end;
  416.  
  417. with Pots[6] do
  418. begin
  419. color := 10847539;
  420. tol := 9;
  421. hmod := 0.02;
  422. smod := 0.14;
  423. cost := 2000;
  424. timeout := 600000;
  425. name := 'Range Potion';
  426. info := 'Increases Range level by 10%';
  427. end;
  428.  
  429. with Pots[7] do
  430. begin
  431. color := 8611642;
  432. tol := 9;
  433. hmod := 0.04;
  434. smod := 0.08;
  435. cost := 1100;
  436. timeout := 500000;
  437. name := 'Magic Potion';
  438. info := 'Increase Magic level by 10%';
  439. end;
  440.  
  441. result := length(Pots);
  442. end;
  443.  
  444. function declarePrayers:Integer;
  445. begin
  446.  
  447. with Prayer[0] do
  448. begin
  449. Location := Point(0, 0);
  450. name := 'Thick skin';
  451. info := 'Increases defense by 5%';
  452. Exceptions := [5, 13, 25, 27, 28, 29];
  453. level := 1;
  454. end;
  455.  
  456. with Prayer[1] do
  457. begin
  458. Location := Point(0, 1);
  459. name := 'Burst of strength';
  460. info := 'Increases strength by 5%';
  461. Exceptions := [3, 4, 6, 11, 12, 14, 20, 21, 25, 27, 28, 29]
  462. level := 4;
  463. end;
  464.  
  465. with Prayer[2] do
  466. begin
  467. Location := Point(0, 2);
  468. name := 'Clarity of thought';
  469. info := 'Increases attack by 5%';
  470. Exceptions := [3, 4, 7, 11, 12, 15, 20, 21, 25, 27, 28, 29];
  471. level := 7;
  472. end;
  473.  
  474. with Prayer[3] do
  475. begin
  476. Location := Point(0, 3);
  477. name := 'Sharp eye';
  478. info := 'Increases range by 5%';
  479. Exceptions := [1, 2, 4, 6, 7, 11, 12, 14, 15, 20, 21, 25, 27, 28, 29];
  480. level := 8;
  481. end;
  482.  
  483. with Prayer[4] do
  484. begin
  485. Location := Point(0, 4);
  486. name := 'Mystic will';
  487. info := 'Increases magic by 5%';
  488. Exceptions := [1, 2, 3, 6, 7, 11, 12, 14, 15, 20, 21, 25, 27, 28, 29];
  489. level := 9;
  490. end;
  491.  
  492. with Prayer[5] do
  493. begin
  494. Location := Point(1, 0);
  495. name := 'Rock skin';
  496. info := 'Increases defense by 10%';
  497. level := 10;
  498. Exceptions := [0, 13, 25, 27, 28, 29];
  499. end;
  500.  
  501. with Prayer[6] do
  502. begin
  503. Location := Point(1, 1);
  504. name := 'Super strength';
  505. info := 'Increases strength by 10%';
  506. Exceptions := [1, 3, 4, 11, 12, 14, 20, 21, 25, 27, 28, 29];
  507. level := 13;
  508. end;
  509.  
  510. with Prayer[7] do
  511. begin
  512. Location := Point(1, 2);
  513. name := 'Improved reflexes';
  514. info := 'Increases attack by 10%';
  515. Exceptions := [2, 3, 4, 11, 12, 15, 20, 21, 25, 27, 28, 29];
  516. level := 16;
  517. end;
  518.  
  519. with Prayer[8] do
  520. begin
  521. Location := Point(1, 3);
  522. name := 'Rapid restore';
  523. info := '2x restore rate for all stats but prayer';
  524. Exceptions := [26];
  525. level := 19;
  526. end;
  527.  
  528. with Prayer[9] do
  529. begin
  530. Location := Point(1, 4);
  531. name := 'Rapid heal';
  532. info := '2x restore rate for health';
  533. Exceptions := [26];
  534. level := 22;
  535. end;
  536.  
  537. with Prayer[10] do
  538. begin
  539. Location := Point(2, 0);
  540. name := 'Protect item';
  541. info := 'Keep 1 extra item if you die';
  542. Exceptions := [];
  543. level := 25;
  544. end;
  545.  
  546. with Prayer[11] do
  547. begin
  548. Location := Point(2, 1);
  549. name := 'Hawk eye';
  550. info := 'Increases range by 10%';
  551. Exceptions := [1, 2, 3, 4, 6, 7, 12, 14, 15, 20, 21, 25, 27, 28, 29];
  552. level := 26;
  553. end;
  554.  
  555. with Prayer[12] do
  556. begin
  557. Location := Point(2, 2);
  558. name := 'Mystic lore';
  559. info := 'Increases magic by 10%';
  560. Exceptions := [1, 2, 3, 4, 6, 7, 11, 14, 15, 20, 21, 25, 27, 28, 29];
  561. level := 27;
  562. end;
  563.  
  564. with Prayer[13] do
  565. begin
  566. Location := Point(2, 3);
  567. name := 'Steel skin';
  568. info := 'Increases defense by 15%';
  569. Exceptions := [0, 5, 25, 27, 28, 29];
  570. level := 28;
  571. end;
  572.  
  573. with Prayer[14] do
  574. begin
  575. Location := Point(2, 4);
  576. name := 'Ultimate strength';
  577. info := 'Increases strength by 15%';
  578. Exceptions := [1, 3, 4, 6, 11, 12, 20, 21, 25, 27, 28, 29];
  579. level := 31;
  580. end;
  581.  
  582. with Prayer[15] do
  583. begin
  584. Location := Point(3, 0);
  585. name := 'Incredible reflexes';
  586. info := 'Increases attack by 15%';
  587. Exceptions := [2, 3, 4, 7, 11, 12, 20, 21, 25, 27, 28, 29];
  588. level := 34;
  589. end;
  590.  
  591. with Prayer[16] do
  592. begin
  593. Location := Point(3, 1);
  594. name := 'Protect summoning';
  595. info := 'null';
  596. Exceptions := [22, 24];
  597. level := 36;
  598. end;
  599.  
  600. with Prayer[17] do
  601. begin
  602. Location := Point(3, 2);
  603. name := 'Protect magic';
  604. info := 'Decreases NPC magic damage by 40%';
  605. Exceptions := [18, 19, 22, 24];
  606. level := 37;
  607. end;
  608.  
  609. with Prayer[18] do
  610. begin
  611. Location := Point(3, 3);
  612. name := 'Protect missiles';
  613. info := 'Decreases NPC range damage by 40%';
  614. Exceptions := [17, 19, 22, 24];
  615. level := 40;
  616. end;
  617.  
  618. with Prayer[19] do
  619. begin
  620. Location := Point(3, 4);
  621. name := 'Protect melee';
  622. info := 'Decreases NPC melee damage by 40%';
  623. Exceptions := [17, 18, 22, 24];
  624. level := 43;
  625. end;
  626.  
  627. with Prayer[20] do
  628. begin
  629. Location := Point(4, 0);
  630. name := 'Eagle eye';
  631. info := 'Increases range by 15%';
  632. Exceptions := [1, 2, 3, 4, 6, 7, 11, 12, 14, 15, 21, 25, 27, 28, 29];
  633. level := 44;
  634. end;
  635.  
  636. with Prayer[21] do
  637. begin
  638. Location := Point(4, 1);
  639. name := 'Mystic mite';
  640. info := 'Increases magic by 15%';
  641. Exceptions := [1, 2, 3, 4, 6, 7, 11, 12, 14, 15, 20, 25, 27, 28, 29];
  642. level := 45;
  643. end;
  644.  
  645. with Prayer[22] do
  646. begin
  647. Location := Point(4, 2);
  648. name := 'Retribution';
  649. info := 'null';
  650. Exceptions := [17, 18, 19, 23, 24];
  651. level := 46;
  652. end;
  653.  
  654. with Prayer[23] do
  655. begin
  656. Location := Point(4, 3);
  657. name := 'Redemption';
  658. info := 'Heals you when your health is low';
  659. Exceptions := [17, 18, 19, 22, 24];
  660. level := 49;
  661. end;
  662.  
  663. with Prayer[24] do
  664. begin
  665. Location := Point(4, 4);
  666. name := 'Smite';
  667. info := 'null';
  668. Exceptions := [17, 18, 19, 22, 23];
  669. level := 52;
  670. end;
  671.  
  672. with Prayer[25] do
  673. begin
  674. Location := Point(5, 0);
  675. name := 'Chivarly';
  676. info := 'def + 20%, str + 18%, and atk + 15%';
  677. Exceptions := [0, 1, 2, 3, 4, 5, 6, 7, 11, 12, 13, 14, 15, 20, 21, 27, 28, 29];
  678. level := 60;
  679. end;
  680.  
  681. with Prayer[26] do
  682. begin
  683. Location := Point(5, 1);
  684. name := 'Rapid renewal';
  685. info := 'Restores life at 5x the normal rate';
  686. Exceptions := [8, 9];
  687. level := 65;
  688. end;
  689.  
  690. with Prayer[27] do
  691. begin
  692. Location := Point(5, 2);
  693. name := 'Peity';
  694. info := 'Def + 25%, str + 23%, and atk+ 20%';
  695. Exceptions := [0, 1, 2, 3, 4, 5, 6, 7, 11, 12, 13, 14, 15, 20, 21, 25, 28, 29];
  696. level := 70;
  697. end;
  698.  
  699. with Prayer[28] do
  700. begin
  701. Location := Point(5, 3);
  702. name := 'Rigour';
  703. info := 'range + 20%, defense + 25%';
  704. Exceptions := [0, 1, 2, 3, 4, 5, 6, 7, 11, 12, 13, 14, 15, 20, 21, 25, 27, 29];
  705. level := 74;
  706. end;
  707.  
  708. with Prayer[29] do
  709. begin
  710. Location := Point(5, 4);
  711. name := 'Augury';
  712. info := 'magic + 20%, defense + 25%';
  713. Exceptions := [0, 1, 2, 3, 4, 5, 6, 7, 11, 12, 13, 14, 15, 20, 21, 25, 27, 28];
  714. level := 77;
  715. end;
  716.  
  717. result := length(Prayer);
  718.  
  719. end;
  720.  
  721. Procedure freeMemory;
  722. var
  723. i:Integer;
  724. begin
  725. Writeln('Thanks for using this script!');
  726. FreeBitmap(casketBMP);
  727. for i := 0 to high(groundObject) do
  728. FreeBitmap(groundObject[i].textbmp);
  729. for i := 0 to high(NPC) do
  730. FreeBitmap(NPC[i].textbmp);
  731. for i := 0 to high(food) do
  732. Freebitmap(Food[i].bmp);
  733. if (loot = true) then
  734. Writeln('==================Loot table==================');
  735. for i := 0 to high(lootItem) do
  736. begin
  737. if (loot = true) then
  738. Writeln('Object ' + groundObject[lootItem[i]].name + ' looted: ' + ToStr(groundObject[lootItem[i]].amount));
  739. end;
  740. Writeln('=============================================');
  741. for i := 0 to high(NPCKill) do
  742. begin
  743. Writeln('===============NPC kill table===============');
  744. Writeln('NPC ' + NPC[NPCKill[i]].name + ' killed ' + ToStr(NPC[NPCKill[i]].killed) + ' times');
  745. end;
  746. if (useFood = true) then
  747. Writeln('===============Food Used===============');
  748. for i := 0 to high(fooduse) do
  749. begin
  750. if (useFood = true) then
  751. Writeln(Food[foodUse[i]].name + ' eaten ' + ToStr(Food[fooduse[i]].used) + ' times (' + ToStr((Food[FoodUse[i]].cost * Food[FoodUse[i]].used)) + ' worth)' );
  752. end;
  753. if (usePrayer = true) then
  754. begin
  755. Writeln('===============Prayer pots Used===============');
  756. Writeln(ToStr(Round(praysDrank/3)) + ' Potions(3)');
  757. end;
  758. if (usePots = true) then
  759. begin
  760. Writeln('===============Potions Used===============');
  761. for i := 0 to high(PotsUse) do
  762. Writeln(Pots[PotsUse[i]].name + '(3) drank ' + ToStr(Round(Pots[PotsUse[i]].used/3)) + ' (' + ToStr((Pots[PotsUse[i]].cost * Pots[PotsUse[i]].used)/3) + ' worth)');
  763. end;
  764. Writeln('=============================================');
  765. end;
  766.  
  767. procedure filterTPAsBetween(var atpa: T2DPointArray; len1, len2: integer);
  768. var
  769. h, l, i: integer;
  770. c: T2DPointArray;
  771. begin
  772. h := high(atpa);
  773. for i := 0 to h do
  774. begin
  775. l := length(atpa[i]);
  776. if (not (inRange(l, len1, len2))) then
  777. begin
  778. setLength(c, length(c) + 1);
  779. c[high(c)] := atpa[i];
  780. end;
  781. end;
  782. atpa := c;
  783. end;
  784.  
  785. procedure TIAAppend(var TIA: TIntegerArray; x: Integer);
  786. var
  787. aL: Integer;
  788. begin
  789. aL := (Length(TIA) + 1);
  790. SetLength(TIA, aL);
  791. TIA[(aL - 1)] := Integer(x);
  792. end;
  793.  
  794. function TIADelete(var TIA: TIntegerArray; x: Integer): Boolean;
  795. var
  796. i, h: Integer;
  797. begin
  798. h := High(TIA);
  799. Result := ((x <= h) and (x > -1));
  800. if not Result then
  801. Exit;
  802. for i := x to (h - 1) do
  803. TIA[i] := TIA[(i + 1)];
  804. SetLength(TIA, h);
  805. end;
  806.  
  807. function IntInArray(int:Integer; TIA:TIntegerArray):Boolean;
  808. var
  809. i:Integer;
  810. begin
  811. for i := 0 to high(TIA) do
  812. if (TIA[i] = int) then result := true;
  813. end;
  814.  
  815. Procedure report(status:string);
  816. var
  817. kills_PH, XP_PH, Loot_PH, timeoutleft, i, killed, XP:Integer;
  818. begin
  819. if (debug = true) then
  820. exit;
  821. for i := 0 to high(NPCKill) do
  822. begin
  823. killed := killed + NPC[NPCKill[i]].killed;
  824. XP := XP + (NPC[NPCKill[i]].XP*NPC[NPCKill[i]].killed);
  825. end;
  826. kills_PH := Round(killed * (3600.0 / (GetTimeRunning / 1000.0)));
  827. XP_PH := Round((killed*12921) * (3600.0 / (GetTimeRunning / 1000.0)));
  828. Loot_PH := Round(Looted * (3600.0 / (GetTimeRunning / 1000.0)));
  829. timeoutleft := (timeout - (TimeFromMark(t)));
  830. Cleardebug;
  831. Writeln('=======================================');
  832. Writeln('Time running: ' + Timerunning);
  833. Writeln('State: ' + Status);
  834. Writeln('Kills: ' + ToStr(GroupDigits(Killed,',')) + ' per hour: ' + ToStr(kills_PH));
  835. Writeln('XP gained: ' + ToStr(GroupDigits(XP,',')) + ' per hour: ' + ToStr(GroupDigits(XP_PH,',')));
  836. if (loot = true) then
  837. Writeln('Items Looted: ' + ToStr(Groupdigits(looted,',')) + ' per hour: ' + ToStr(Loot_PH));
  838. Writeln('Timeout left: ' + ToStr(GroupDigits(timeoutleft,',')));
  839. Writeln('=======================================');
  840. end;
  841.  
  842. Procedure dBug(bugmsg:string);
  843. begin
  844. if (debug = true) then
  845. Writeln(ToStr(bugmsg));
  846. end;
  847.  
  848. function containsText():boolean;
  849. var
  850. x,y:Integer;
  851. begin
  852. Result := FindColortolerance(x, y, 188639, 8, 8, 157, 24, 50);
  853. end;
  854.  
  855. function t_loggedin:Boolean;
  856. begin
  857. result := (GetColor(472, 491) = 16777215);
  858. end;
  859.  
  860. Procedure t_SetangleHigh();
  861. begin
  862. Keydown(VK_Up);
  863. wait(RandomRange(2000, 3000));
  864. KeyUp(VK_Up);
  865. end;
  866.  
  867. function CompassBalenced():Boolean;
  868. var
  869. x, y:Integer;
  870. begin
  871. Result := (FindColortolerance(x, y, 1911089, 542, 11, 545, 14, 20) and (FindColortolerance(x, y, 920735, 530, 24, 534, 27, 25)));
  872. end;
  873.  
  874. Procedure MakeCompassNorth;
  875. begin
  876. if not CompassBalenced() then
  877. begin
  878. MarkTime(t);
  879. Keydown(VK_Right);
  880. Dbug('Making compass north');
  881. waitfunc(@CompassBalenced, 100, 3000);
  882. KeyUp(VK_Right);
  883. end;
  884. end;
  885.  
  886. function findGroundItem(col, tol, w, h, filter, tBMP:Integer; hmod, smod:extended):Boolean;
  887. var
  888. TPA:TPointArray;
  889. ATPA:T2DPointArray;
  890. i, x, y, tx, ty:Integer;
  891. begin
  892. if (not t_loggedin) then exit;
  893. Dbug('Looking for ground items');
  894. ColorToleranceSpeed(2);
  895. SetColorSpeed2Modifiers(hmod, smod);
  896. FindColorsSpiralTolerance(256, 166, TPA, col, 3, 3, 514, 339, tol);
  897. ColorToleranceSpeed(1);
  898. SetColorSpeed2Modifiers(0.02, 0.02);
  899. if (Length(TPA) > 0) then
  900. begin
  901. Dbug('TPA length: ' + toStr(Length(TPA)));
  902. ATPA := TPAToATPAEx(TPA, w, h);
  903. filterTPAsBetween(ATPA, 1, filter);
  904. SortATPAFromFirstpoint(ATPA, Point(256, 166));
  905. Dbug('ATPA length: ' + toStr(Length(ATPA)));
  906. if (debug = true) then
  907. DebugATPABounds(ATPA);
  908. for i := 0 to high(ATPA) do
  909. begin
  910. MiddleTPAEx(ATPA[i], x, y);
  911. mouse(x, y, 0, 0, Mouse_Right);
  912. wait(300);
  913. if findBitmapToleranceIn(TBMP, tx, ty, 0, 0, 514, 339, 100) then
  914. begin
  915. result := true;
  916. mouse(tx, ty, 0, 0, Mouse_Left);
  917. wait(1200);
  918. while (ismoving) do
  919. wait(200);
  920. exit;
  921. end;
  922. end;
  923. end;
  924. end;
  925.  
  926. procedure t_logout;
  927. begin
  928. Mouse(755, 11, 0, 0, Mouse_left);
  929. wait(400);
  930. Mouse(641, 406, 0, 0, Mouse_left);
  931. wait(500);
  932. end;
  933.  
  934. function findPotion(col, tol:Integer;hmod, smod:Extended):Boolean;
  935. var
  936. TPA:TPointArray;
  937. ATPA:T2DPointArray;
  938. x, y:Integer;
  939. begin
  940. if (not t_loggedin) then
  941. exit;
  942. Dbug('Looking for Potion');
  943. ColorToleranceSpeed(2);
  944. SetColorSpeed2Modifiers(hmod, smod);
  945. FindColorsSpiralTolerance(579, 235, TPA, col, 551, 208, 733, 465, tol);
  946. ColorToleranceSpeed(1);
  947. SetColorSpeed2Modifiers(0.02, 0.02);
  948. if (Length(TPA) > 0) then
  949. begin
  950. Dbug('TPA length: ' + toStr(Length(TPA)));
  951. ATPA := TPAToATPAEx(TPA, 7, 4);
  952. SortATPAFromFirstpoint(ATPA, Point(579, 235));
  953. Dbug('ATPA length: ' + toStr(Length(ATPA)));
  954. if (debug = true) then
  955. DebugATPABounds(ATPA);
  956. MiddleTPAEx(ATPA[0], x, y);
  957. Mouse(x, y, 0, 0, Mouse_left);
  958. wait(1000);
  959. result := true;
  960. end;
  961. end;
  962.  
  963. procedure tabInv;
  964. var
  965. x, y:Integer;
  966. begin
  967. if not FindColorTolerance(x, y, 4303081, 642, 170, 672, 205, 18) then
  968. Mouse(658, 188, 0, 0, Mouse_left);
  969. end;
  970.  
  971. function lowPrayer:Boolean;
  972. var
  973. x, y:Integer;
  974. begin
  975. result := not FindColorTolerance(x, y, 65280, 740, 71, 759, 80, 15);
  976. end;
  977.  
  978. procedure prayUp;
  979. begin
  980. if (lowPrayer) then
  981. begin
  982. case (PrayPotType) of
  983. 'pray':
  984. begin
  985. Report('Drinking prayer pots');
  986. case findPotion(8037427, 9, 0.03, 0.11) of
  987. True: praysdrank := praysdrank +1;
  988. False:
  989. begin
  990. if (keepPraying = true) then
  991. begin
  992. Writeln('Ran out of prayer pots, terminating');
  993. t_logout;
  994. TerminateScript;
  995. end;
  996. end;
  997. end;
  998. end;
  999. 'restore':
  1000. begin
  1001. Report('Drinking resture pots');
  1002. case findPotion(5191290, 8, 0.03, 0.09) of
  1003. True: praysdrank := praysdrank +1;
  1004. False:
  1005. begin
  1006. if (keepPraying = true) then
  1007. begin
  1008. Writeln('Ran out of prayer pots, terminating');
  1009. t_logout;
  1010. TerminateScript;
  1011. end;
  1012. end;
  1013. end;
  1014. end;
  1015. end;
  1016. end;
  1017. end;
  1018.  
  1019. procedure tabPrayer;
  1020. begin
  1021. Mouse(717, 189, 0, 0, Mouse_left);
  1022. end;
  1023.  
  1024. procedure startPrayer;
  1025. var
  1026. basex, basey, i:Integer;
  1027. begin
  1028. basex := 570;
  1029. basey := 227;
  1030. tabPrayer;
  1031. wait(300);
  1032. for i := 0 to high(PrayUse) do
  1033. begin
  1034. Mouse(basex + (37 * Prayer[PrayUse[i]].location.y), basey + (35 * Prayer[PrayUse[i]].location.x), 0, 0, Mouse_left);
  1035. wait(400);
  1036. end;
  1037. end;
  1038.  
  1039. function needEat:Boolean;
  1040. var
  1041. x, y:Integer;
  1042. begin
  1043. result := not FindColorTolerance(x, y, 65280, 723, 31, 745, 41, 15);
  1044. end;
  1045.  
  1046. procedure eatUp;
  1047. var
  1048. i, x, y:Integer;
  1049. begin
  1050. if (needEat) then
  1051. begin
  1052. report('Eating Food');
  1053. tabInv;
  1054. for i := 0 to high(fooduse) do
  1055. begin
  1056. if (needEat) then // added again to avoid overeating
  1057. begin
  1058. case (FindbitmapToleranceIn(Food[FoodUse[i]].bmp, x, y, 551, 211, 738, 467, Food[FoodUse[i]].tol)) of
  1059. True:
  1060. begin
  1061. Food[FoodUse[i]].used := Food[FoodUse[i]].used + 1;
  1062. wait(600);
  1063. end;
  1064. False:
  1065. begin
  1066. report('Ran out of food');
  1067. wait(4000);
  1068. t_logout;
  1069. Writeln('ran out of food script terminate');
  1070. TerminateScript;
  1071. end;
  1072. end;
  1073. end;
  1074. end;
  1075. end;
  1076. end;
  1077.  
  1078. procedure potUp;
  1079. var
  1080. i:Integer;
  1081. needPot:Boolean;
  1082. begin
  1083. if (ranout = true) then
  1084. exit;
  1085. if (Debug) then
  1086. begin
  1087. for i := 0 to high(PotsUse) do
  1088. Writeln(Pots[PotsUse[i]].name + ' ' + ToStr(TimeFromMark(Pots[PotsUse[i]].time)) + ' ms');
  1089. end;
  1090. for i := 0 to high(PotsUse) do
  1091. begin
  1092. if (TimeFromMark(Pots[PotsUse[i]].time)>Pots[PotsUse[i]].timeout) then
  1093. begin
  1094. Report('Drinking ' + Pots[PotsUse[i]].name);
  1095. tabInv;
  1096. case findPotion(Pots[PotsUse[i]].color, Pots[PotsUse[i]].tol, Pots[PotsUse[i]].hmod, Pots[PotsUse[i]].smod) of
  1097. True:
  1098. begin
  1099. Pots[PotsUse[i]].used := Pots[PotsUse[i]].used + 1;
  1100. MarkTime(Pots[PotsUse[i]].time);
  1101. end;
  1102. False:
  1103. begin
  1104. case KeepPotting of
  1105. True:
  1106. begin
  1107. Writeln('Ran out of pots, Terminating script!');
  1108. t_logout;
  1109. TerminateScript;
  1110. end;
  1111. False: ranout := true;
  1112. end;
  1113. end;
  1114. end;
  1115. end;
  1116. end;
  1117. end;
  1118.  
  1119. procedure lootItems;
  1120. var
  1121. i:Integer;
  1122. begin
  1123. if (loot = false) then exit;
  1124. Dbug('Starting loot items procedure');
  1125. for i := 0 to high(lootItem) do
  1126. begin
  1127. report('Looting ' + groundObject[lootItem[i]].name);
  1128. Dbug('Looting ' + groundObject[lootItem[i]].name);
  1129. if findGroundItem(groundObject[lootItem[i]].color, groundObject[lootItem[i]].tol, groundObject[lootItem[i]].width, groundObject[lootItem[i]].height, groundObject[lootItem[i]].filter, groundObject[lootItem[i]].textBMP, groundObject[lootItem[i]].hmod, groundObject[lootItem[i]].smod) then
  1130. begin
  1131. Dbug('Found ' + groundObject[lootItem[i]].name)
  1132. inc(groundObject[lootItem[i]].amount);
  1133. looted := looted+1;
  1134. end;
  1135. end;
  1136. end;
  1137.  
  1138. Procedure usecaskets;
  1139. var
  1140. x, y:Integer;
  1141. begin
  1142. tabInv;
  1143. If FindBitMapToleranceIn(casketBMP, x, y, 556, 213, 732, 462, 130) then
  1144. begin
  1145. report('Opening casket');
  1146. DBug('Opening casket');
  1147. Mouse(x, y, 0, 0, Mouse_left);
  1148. wait(500);
  1149. end;
  1150. end;
  1151.  
  1152. function countText:Integer;
  1153. var
  1154. textTPA:TPointArray;
  1155. begin
  1156. FindColorsTolerance(textTPA, 12378347, 251, 145, 514, 362, 1);
  1157. result := length(textTPA);
  1158. end;
  1159.  
  1160. function LoginError:String;
  1161. begin
  1162. case (countText) of
  1163. 364: result := 'internet';
  1164. 2181: result := 'details';
  1165. end;
  1166. end;
  1167.  
  1168. function d_boxup:Boolean;
  1169. begin
  1170. result := (CountColortolerance(1842209, 270, 172, 493, 250, 5)<200);
  1171. end;
  1172.  
  1173. Procedure DeleteSpace(amt:integer);
  1174. var
  1175. i:integer;
  1176. begin
  1177. for i := 0 to amt do
  1178. begin
  1179. KeyDown(8);
  1180. wait(40);
  1181. end;
  1182. KeyUp(8);
  1183. end;
  1184.  
  1185. function noDetails:Boolean;
  1186. begin
  1187. result := ((t_username = '') or (t_password = ''));
  1188. end;
  1189.  
  1190. Procedure t_loginPlayer;
  1191. var
  1192. x, y:Integer;
  1193. begin
  1194. if t_loggedin then exit;
  1195. if noDetails then
  1196. begin
  1197. Writeln('You are logged out and did not enter in any login details, terminating script');
  1198. TerminateScript;
  1199. end;
  1200. if (d_boxup) then
  1201. begin
  1202. case (LoginError) of
  1203. 'internet':
  1204. begin
  1205. Writeln('Error connecting to server waiting');
  1206. wait(10000);
  1207. Mouse(381, 320, 0, 0, Mouse_left);
  1208. wait(500);
  1209. end;
  1210. 'details':
  1211. begin
  1212. Writeln('Invalid username or password');
  1213. Mouse(378, 375, 0, 0, Mouse_left);
  1214. wait(500)
  1215. end;
  1216. end;
  1217. end;
  1218. if findColorTolerance(x, y, 1315865, 280, 175, 486, 197, 15) then
  1219. begin
  1220. Mouse(475, 186, 0, 0, Mouse_Left);
  1221. DeleteSpace(20);
  1222. TypeSend(t_username);
  1223. wait(200);
  1224. DeleteSpace(15);
  1225. TypeSend(t_password);
  1226. waitfunc(@T_loggedin, 400, 5000);
  1227. end;
  1228. end;
  1229.  
  1230. function hpExists(bounds:TBox; offx, offy:Integer):Boolean;
  1231. var
  1232. counts: array[0..1] of integer;
  1233. begin
  1234. // arrays not needed but looks better IMO
  1235. if (not t_loggedin) then exit;
  1236. try
  1237. ColorToleranceSpeed(2);
  1238. SetColorSpeed2Modifiers(0.76, 0.00);
  1239. counts[0] := CountColorTolerance(48994, bounds.x1-offx, bounds.y1-offy, bounds.x2, bounds.y2, 6);
  1240. SetColorSpeed2Modifiers(5.50, 0.26);
  1241. counts[1] := CountColorTolerance(11644162, bounds.x1-offx, bounds.y1-offy, bounds.x2, bounds.y2, 9);
  1242. ColorToleranceSpeed(1);
  1243. SetColorSpeed2Modifiers(0.02, 0.02);
  1244. DBug('Green count: ' + ToStr(counts[0]) + ' Red count: ' + toStr(counts[1]));
  1245. if (counts[0]>30) or (counts[1]>30) then
  1246. result := true;
  1247. except
  1248. Writeln('TBox is out of Bounds');
  1249. result := false;
  1250. end;
  1251. end;
  1252.  
  1253. function isFighting:Boolean;
  1254. var
  1255. Bounds:Tbox;
  1256. begin
  1257. Bounds := IntToBox(246, 141, 285, 170);
  1258. result := hpExists(Bounds, 0, 10);
  1259. end;
  1260.  
  1261. Procedure waitingProc;
  1262. begin
  1263. Dbug('Found NPC');
  1264. wait(waitclick);
  1265. while (isMoving) do
  1266. wait(200);
  1267. end;
  1268.  
  1269. function findNPC(col, tol, w, h, filter, tBMP:Integer; hmod, smod:extended; clickR:Boolean):Boolean;
  1270. var
  1271. TPA:TPointArray;
  1272. ATPA:T2DPointArray;
  1273. i, x, y, tx, ty:Integer;
  1274. Bounds:TBox;
  1275. begin
  1276. DBug('Started find NPC proc');
  1277. ColorToleranceSpeed(2);
  1278. SetColorSpeed2Modifiers(hmod, smod);
  1279. FindColorsSpiralTolerance(256, 166, TPA, col, 3, 3, 514, 339, tol);
  1280. ColorToleranceSpeed(1);
  1281. SetColorSpeed2Modifiers(0.02, 0.02);
  1282. if (Length(TPA) > 0) then
  1283. begin
  1284. DBug('TPA length: ' + ToStr(length(TPA)));
  1285. ATPA := TPAToATPAEx(TPA, w, h);
  1286. filterTPAsBetween(ATPA, 1, filter);
  1287. SortATPAFromFirstpoint(ATPA, Point(256, 166));
  1288. DBug('ATPA length: ' + ToStr(length(ATPA)));
  1289. if (debug = true) then
  1290. DebugATPABounds(ATPA);
  1291. for i := 0 to high(ATPA) do
  1292. begin
  1293. Bounds := GetTPABounds(ATPA[i]);
  1294. MiddleTPAEx(ATPA[i], x, y);
  1295. if not hpExists(Bounds, 6, 6) then
  1296. begin
  1297. mmouse(x, y, 0, 0);
  1298. if waitfunc(@containsText,50, 300) then
  1299. begin
  1300. case (ClickR) of
  1301. True:
  1302. begin
  1303. ClickMouse2(Mouse_Right);
  1304. wait(300);
  1305. If FindBitMapToleranceIn(tBMP, tx, ty, 3, 3, 514, 339, 130) then
  1306. begin
  1307. result := true;
  1308. mouse(tx, ty, 0, 0, Mouse_left);
  1309. waitingProc;
  1310. exit;
  1311. end;
  1312. end;
  1313. False:
  1314. begin
  1315. result := true;
  1316. ClickMouse2(Mouse_left);
  1317. waitingproc;
  1318. exit;
  1319. end;
  1320. end;
  1321. end;
  1322. end;
  1323. end;
  1324. end;
  1325. end;
  1326.  
  1327. Procedure fightNPCs;
  1328. var
  1329. i:Integer;
  1330. begin
  1331. for i:= 0 to high(NPCKill) do
  1332. begin
  1333. DBug('Finding NPC ' + NPC[NPCKill[i]].name);
  1334. case (findNPC(NPC[NPCKill[i]].Color, NPC[NPCKill[i]].tol, NPC[NPCKill[i]].width, NPC[NPCKill[i]].height, NPC[NPCKill[i]].filter, NPC[NPCKill[i]].textBMP, NPC[NPCKill[i]].hmod, NPC[NPCKill[i]].smod, NPC[NPCKill[i]].RClick)) of
  1335. True:
  1336. begin
  1337. marktime(t);
  1338. repeat
  1339. MarkTime(failsafe);
  1340. report('Attacking ' + NPC[NPCKill[i]].name);
  1341. wait(200);
  1342. if (useFood = true) then
  1343. eatUp;
  1344. if (usePrayer = true) then
  1345. PrayUp;
  1346. until (not Isfighting) or (TimeFromMark(t) > timeout);
  1347. if (not isfighting) then
  1348. begin
  1349. NPC[NPCKill[i]].killed := NPC[NPCKill[i]].killed +1;
  1350. lootItems;
  1351. end;
  1352. end;
  1353. False:
  1354. begin
  1355. report('Could not find ' + NPC[NPCKill[i]].name);
  1356. MarkTime(failsafe);
  1357. wait(500);
  1358. end;
  1359. end;
  1360. end;
  1361. end;
  1362.  
  1363. procedure Update(Sender: TObject);
  1364. var
  1365. latestVersion: Extended;
  1366. str: string;
  1367. begin
  1368. WriteLn('Getting update information, please wait.');
  1369. WriteLn('This step may take a couple seconds!');
  1370. str := GetPage('http://villavu.com/forum/showthread.php?t=105062');
  1371. latestVersion := StrToFloatDef(Between('autoupdate', 'abcdef', str), -1);
  1372. case (latestVersion > -1) of
  1373. True:
  1374. begin
  1375. WriteLn('Current Version: ' + FloatToStr(VERSION) + ' | Latest Version: ' + FloatToStr(latestVersion));
  1376. case (VERSION = latestVersion) of
  1377. False:
  1378. case (VERSION < latestVersion) of
  1379. True:
  1380. begin
  1381. WriteLn('You dont have the latest version, you can download the latest version from the thread.');
  1382. OpenWebPage('http://villavu.com/forum/showthread.php?t=105062');
  1383. end;
  1384. False: WriteLn('Looks like your version is newer than the latest version - YAY!');
  1385. end;
  1386. True: WriteLn('Your version is up to date!');
  1387. end;
  1388. end;
  1389. False: WriteLn('Failed to check the latest version... Connection problems?');
  1390. end;
  1391. end;
  1392.  
  1393. procedure error(ErrorS:string);
  1394. begin
  1395. MessageBox(ErrorS, 'Error', 16);
  1396. end;
  1397.  
  1398. procedure SaveForm(sender: TObject);
  1399. begin
  1400. FormData.fightForm.ModalResult := mrOk;
  1401. Loot := FormData.CheckBoxes[0].CHECKED;
  1402. debug := FormData.CheckBoxes[1].CHECKED;
  1403. usecasket := FormData.CheckBoxes[2].CHECKED;
  1404. usePrayer := FormData.CheckBoxes[3].CHECKED;
  1405. keepPraying := FormData.CheckBoxes[4].CHECKED;
  1406. usePots := FormData.CheckBoxes[5].CHECKED;
  1407. keepPotting := FormData.CheckBoxes[6].CHECKED;
  1408. useFood := FormData.CheckBoxes[7].CHECKED;
  1409. t_username := FormData.Edits[0].TEXT;
  1410. t_password := FormData.Edits[1].TEXT;
  1411. if (FormData.TimeOutEdit.text <> 'Combat Timeout') then
  1412. timeout := StrToInt(FormData.TimeOutEdit.text);
  1413. if (FormData.TimeOutEdit.text = 'Combat Timeout') then
  1414. timeout := 19000;
  1415. if (FormData.ClickDelay.text <> 'Click delay after attack') then
  1416. waitclick := StrToInt(FormData.ClickDelay.TEXT);
  1417. if (FormData.ClickDelay.text = 'Click delay after attack') then
  1418. waitClick := 1700;
  1419. case FormData.PrayCombo.ITEMINDEX of
  1420. 0: PrayPotType := 'pray';
  1421. 1: PrayPotType := 'restore';
  1422. end;
  1423. pressed := true;
  1424. FormData.FightForm.CLOSE;
  1425. end;
  1426.  
  1427. procedure UpdateInfo(Sender:TObject);
  1428. var
  1429. i:Integer;
  1430. begin
  1431. case sender of
  1432. FormData.Options[0]:
  1433. begin
  1434. if (FormData.Options[0].itemindex > - 1) then
  1435. begin
  1436. FormData.FoodInfo[0].Caption := 'Heals: ' + ToStr(Food[FormData.Options[0].ItemIndex].heal);
  1437. FormData.FoodInfo[1].Caption := 'Cost: ' + ToStr(Food[FormData.Options[0].ItemIndex].cost);
  1438. FormData.FoodButtons[0].enabled := true;
  1439. end;
  1440. end;
  1441. FormData.Options[1]:
  1442. begin
  1443. if (FormData.Options[1].itemindex > - 1) then
  1444. begin
  1445. FormData.PotionButtons[0].enabled := true
  1446. FormData.PotionInfo[0].Caption := Pots[FormData.Options[1].ItemIndex].info;
  1447. FormData.PotionInfo[1].Caption := 'Cost: ' + ToStr(Pots[FormData.Options[1].ItemIndex].cost);
  1448. end;
  1449. end;
  1450. FormData.Options[2]:
  1451. begin
  1452. if (FormData.Options[2].itemindex > - 1) then
  1453. begin
  1454. FormData.NPCInfo[0].Caption := 'Combat Level:' + ToStr(NPC[FormData.Options[2].ItemIndex].Combat);
  1455. FormData.NPCInfo[1].Caption := 'Health: ' + ToStr(NPC[FormData.Options[2].ItemIndex].Health);
  1456. FormData.DropList.ITEMS.Clear;
  1457. FormData.DropList.visible := true;
  1458. FormData.NPCButtons[0].enabled := true;
  1459. FormData.NPCLabels[2].visible := true;
  1460. for i := 0 to high(NPC[FormData.Options[2].ItemIndex].drops) do
  1461. FormData.DropList.ITEMS.Add(groundObject[NPC[FormData.Options[2].ItemIndex].Drops[i]].name);
  1462. end;
  1463. end;
  1464. FormData.Options[3]:
  1465. begin
  1466. if (FormData.Options[3].itemindex > - 1) then
  1467. begin
  1468. FormData.LootButtons[0].enabled := true;
  1469. FormData.LootInfo[0].Caption := groundObject[FormData.Options[3].ItemIndex].name;
  1470. FormData.LootInfo[1].Caption := 'Value:' + groundObject[FormData.Options[3].ItemIndex].value;
  1471. FormData.LootInfo[2].Caption := 'Rarity: ' + ToStr(groundObject[FormData.Options[3].ItemIndex].odds);
  1472. end;
  1473. end;
  1474. FormData.Options[4]:
  1475. begin
  1476. if (FormData.Options[4].itemindex > - 1) then
  1477. begin
  1478. FormData.PrayButtons[0].enabled := true;
  1479. FormData.PrayLabels[0].Caption := Prayer[FormData.options[4].ItemIndex].name;
  1480. FormData.PrayLabels[1].Caption := 'Level: ' + toStr(Prayer[FormData.options[4].ItemIndex].level);
  1481. FormData.PrayLabels[2].Caption := Prayer[FormData.options[4].ItemIndex].info;
  1482. end;
  1483. end;
  1484. end;
  1485. end;
  1486.  
  1487. procedure Updatechosen(sender:TObject);
  1488. begin
  1489. case sender of
  1490. FormData.Chosen[0]:
  1491. begin
  1492. if (high(FoodUse) > -1) then
  1493. FormData.FoodButtons[1].enabled := true;
  1494. end;
  1495. FormData.Chosen[1]:
  1496. begin
  1497. if (high(PotsUse) > -1) then
  1498. FormData.PotionButtons[1].enabled := true;
  1499. end;
  1500. FormData.Chosen[2]:
  1501. begin
  1502. if (high(NPCKill) > -1) then
  1503. FormData.NPCButtons[1].enabled := true;
  1504. end;
  1505. FormData.Chosen[3]:
  1506. begin
  1507. if (high(LootItem) > -1) then
  1508. FormData.LootButtons[1].enabled := true;
  1509. end;
  1510. FormData.Chosen[4]:
  1511. begin
  1512. if (high(PrayUse) > -1) then
  1513. FormData.PrayButtons[1].enabled := true;
  1514. end;
  1515. end;
  1516. end;
  1517.  
  1518. function Exception: Boolean;
  1519. var
  1520. i, l:Integer;
  1521. begin
  1522. for i := 0 to high(PrayUse) do
  1523. begin
  1524. for l := 0 to high(Prayer[PrayUse[i]].Exceptions) do
  1525. begin
  1526. if (FormData.Options[4].ItemIndex = Prayer[PrayUse[i]].Exceptions[l]) then
  1527. begin
  1528. error('You can not use ' + Prayer[FormData.Options[4].ItemIndex].name + ' and ' + Prayer[PrayUse[i]].name + ' at the same time!');
  1529. result := true;
  1530. exit;
  1531. end;
  1532. end;
  1533. end;
  1534. end;
  1535.  
  1536. procedure UpdateLoot(sender:TObject);
  1537. var
  1538. i:Integer;
  1539. begin
  1540. case sender of
  1541. FormData.LootButtons[0]:
  1542. begin
  1543. if not IntInArray(FormData.Options[3].ItemIndex, LootItem) then
  1544. begin
  1545. FormData.CheckBoxes[0].CHECKED := true;
  1546. TIAAppend(LootItem, FormData.Options[3].ItemIndex);
  1547. FormData.Chosen[3].items.clear;
  1548. for
  1549. i := 0 to high(LootItem) do
  1550. FormData.Chosen[3].items.add(groundObject[LootItem[i]].name);
  1551. if (FormData.Options[3].itemIndex < 0) then
  1552. FormData.LootButtons[0].enabled := false;
  1553. end else if IntInArray(FormData.Options[3].ItemIndex, LootItem) then
  1554. Error('You already added that Loot!')
  1555. end;
  1556. FormData.LootButtons[1]:
  1557. begin
  1558. if (FormData.Options[3].ItemIndex > - 1) then
  1559. begin
  1560. TIADelete(LootItem, FormData.Chosen[3].ItemIndex);
  1561. FormData.Chosen[3].items.clear;
  1562. for i := 0 to high(LootItem) do
  1563. FormData.Chosen[3].items.add(groundObject[LootItem[i]].name);
  1564. FormData.LootButtons[1].enabled := false;
  1565. if (length(LootItem) < 1) then
  1566. FormData.CheckBoxes[0].CHECKED := false;
  1567. end else if (FormData.Options[3].ItemIndex < - 1) then
  1568. Error('No selected Loot to delete!');
  1569. end;
  1570. end;
  1571. end;
  1572.  
  1573. procedure UpdateFood(sender:TObject);
  1574. var
  1575. i:Integer;
  1576. begin
  1577. case sender of
  1578. FormData.FoodButtons[0]:
  1579. begin
  1580. if not IntInArray(FormData.Options[0].ItemIndex, FoodUse) then
  1581. begin
  1582. FormData.CheckBoxes[7].CHECKED := true;
  1583. TIAAppend(FoodUse, FormData.Options[0].ItemIndex);
  1584. FormData.Chosen[0].items.clear;
  1585. for
  1586. i := 0 to high(FoodUse) do
  1587. FormData.Chosen[0].items.add(Food[FoodUse[i]].name);
  1588. if (FormData.Options[0].itemIndex < 0) then
  1589. FormData.FoodButtons[0].enabled := false;
  1590. end else if IntInArray(FormData.Options[0].ItemIndex, FoodUse) then
  1591. Error('You already added that Food!')
  1592. end;
  1593. FormData.FoodButtons[1]:
  1594. begin
  1595. if (FormData.Options[0].ItemIndex > - 1) then
  1596. begin
  1597. TIADelete(FoodUse, FormData.Chosen[0].ItemIndex);
  1598. FormData.Chosen[0].items.clear;
  1599. for i := 0 to high(FoodUse) do
  1600. FormData.Chosen[0].items.add(Food[FoodUse[i]].name);
  1601. FormData.FoodButtons[1].enabled := false;
  1602. if (length(FoodUse) < 1) then
  1603. FormData.CheckBoxes[7].CHECKED := false;
  1604. end else if (FormData.Options[0].ItemIndex < - 1) then
  1605. Error('No selected Food to delete!');
  1606. end;
  1607. end;
  1608. end;
  1609.  
  1610. procedure UpdatePotions(sender:TObject);
  1611. var
  1612. i:Integer;
  1613. begin
  1614. case sender of
  1615. FormData.PotionButtons[0]:
  1616. begin
  1617. if not IntInArray(FormData.Options[1].ItemIndex, PotsUse) then
  1618. begin
  1619. FormData.CheckBoxes[5].CHECKED := true;
  1620. TIAAppend(PotsUse, FormData.Options[1].ItemIndex);
  1621. FormData.Chosen[1].items.clear;
  1622. for
  1623. i := 0 to high(PotsUse) do
  1624. FormData.Chosen[1].items.add(Pots[PotsUse[i]].name);
  1625. if (FormData.Options[1].itemIndex < 0) then
  1626. FormData.PotionButtons[0].enabled := false;
  1627. end else if IntInArray(FormData.Options[1].ItemIndex, PotsUse) then
  1628. Error('You already added that Potion!')
  1629. end;
  1630. FormData.PotionButtons[1]:
  1631. begin
  1632. if (FormData.Options[1].ItemIndex > - 1) then
  1633. begin
  1634. TIADelete(PotsUse, FormData.Chosen[1].ItemIndex);
  1635. FormData.Chosen[1].items.clear;
  1636. for i := 0 to high(PotsUse) do
  1637. FormData.Chosen[1].items.add(Pots[PotsUse[i]].name);
  1638. FormData.PotionButtons[1].enabled := false;
  1639. if (length(PotsUse) < 1) then
  1640. FormData.CheckBoxes[5].CHECKED := false;
  1641. end else if (FormData.Options[1].ItemIndex < - 1) then
  1642. Error('No selected Potion to delete!');
  1643. end;
  1644. end;
  1645. end;
  1646.  
  1647. procedure UpdatePrayerList(sender:TObject);
  1648. var
  1649. i, l:Integer;
  1650. begin
  1651. case sender of
  1652. FormData.PrayButtons[0]:
  1653. begin
  1654. if not IntInArray(FormData.Options[4].ItemIndex, PrayUse) then
  1655. begin
  1656. if (not Exception) then
  1657. begin
  1658. FormData.CheckBoxes[3].CHECKED := true;
  1659. TIAAppend(PrayUse, FormData.Options[4].ItemIndex);
  1660. FormData.Chosen[4].ITEMS.Clear;
  1661. for i := 0 to high(prayUse) do
  1662. FormData.Chosen[4].ITEMS.Add(Prayer[PrayUse[i]].name);
  1663. end;
  1664. end else if IntInArray(FormData.Options[4].ItemIndex, PrayUse) then
  1665. begin
  1666. Error('You already added that prayer!');
  1667. end;
  1668. end;
  1669. FormData.PrayButtons[1]:
  1670. begin
  1671. if (FormData.Options[4].ItemIndex > - 1) then
  1672. begin
  1673. TIADelete(PrayUse, FormData.chosen[4].ItemIndex);
  1674. FormData.Chosen[4].items.clear;
  1675. for i := 0 to high(PrayUse) do
  1676. FormData.Chosen[4].items.add(Prayer[PrayUse[i]].name);
  1677. FormData.PrayButtons[1].enabled := false;
  1678. if (length(PotsUse) < 1) then
  1679. FormData.CheckBoxes[3].CHECKED := false;
  1680. end else if (FormData.Options[4].ItemIndex < - 1) then
  1681. Error('No selected Prayer to delete!')
  1682. end;
  1683. end;
  1684. end;
  1685.  
  1686. procedure UpdateKillList(Sender:TObject);
  1687. var
  1688. i, reply:Integer;
  1689. strings:TStringArray;
  1690. begin
  1691. case sender of
  1692. FormData.NPCButtons[0]:
  1693. begin
  1694. if not IntInArray(FormData.Options[2].ItemIndex, NPCKill) then
  1695. begin
  1696. TIAAppend(NPCKill, FormData.Options[2].ItemIndex);
  1697. FormData.Chosen[2].items.clear;
  1698. for i := 0 to high(NPCKill) do
  1699. FormData.Chosen[2].items.add(NPC[NPCKill[i]].name);
  1700. if (FormData.Options[2].itemIndex < 0) then
  1701. FormData.NPCButtons[0].enabled := false;
  1702. end else if IntInArray(FormData.Options[2].ItemIndex, NPCKill) then
  1703. Error('You already added that NPC!')
  1704. end;
  1705. FormData.NPCButtons[1]:
  1706. begin
  1707. if (FormData.Chosen[2].ItemIndex > - 1) then
  1708. begin
  1709. TIADelete(NPCKill, FormData.Chosen[2].ItemIndex);
  1710. FormData.Chosen[2].items.clear;
  1711. for i := 0 to high(NPCKill) do
  1712. FormData.Chosen[2].items.add(NPC[NPCKill[i]].name);
  1713. FormData.NPCButtons[1].enabled := false;
  1714. end else if (FormData.Options[2].ItemIndex < - 1) then
  1715. Error('No selected NPC to delete!');
  1716. end;
  1717. FormData.NPCButtons[2]:
  1718. begin
  1719. reply := Messagebox('Please fillout this information', 'Information', 1);
  1720. if (reply = 1) then
  1721. begin
  1722. Strings := ['NPC Name', 'Health', 'Combat level', 'Drops', 'Screeny (link)[img][/img]'];
  1723. for i := 0 to 4 do
  1724. Writeln(Strings[i]);
  1725. Writeln('**********Please post this information on the thread!');
  1726. wait(2000);
  1727. OpenWebPage('http://villavu.com/forum/showthread.php?t=105062');
  1728. end;
  1729. end;
  1730. end;
  1731. end;
  1732.  
  1733. procedure Other(sender:TObject);
  1734. begin
  1735. case sender of
  1736. FormData.Buttons[0]:
  1737. begin
  1738. pressed := false;
  1739. FormData.FightForm.CLOSE;
  1740. end;
  1741. formData.Buttons[1]: OpenWebPage('http://villavu.com/forum/showthread.php?t=105062');
  1742. FormData.Buttons[2]: OpenWebPage('http://villavu.com/forum/private.php?do=newpm&u=63718');
  1743. end;
  1744. end;
  1745.  
  1746. procedure loadForm;
  1747. var
  1748. i:Integer;
  1749. Strings:TStringArray;
  1750. Positions, Sizes:TPointArray;
  1751. begin
  1752. FormData.FightForm := TForm.Create(nil);
  1753. with FormData.FightForm do
  1754. begin
  1755. Caption := 'Telos-Reborn Auto Fighter Version ' + Disp;
  1756. top := 200;
  1757. left := 200;
  1758. width := 540;
  1759. height := 310;
  1760. end;
  1761. Formdata.TPage := TPageControl.Create(FormData.FightForm);
  1762. with Formdata.TPage do
  1763. begin
  1764. parent := FormData.FightForm
  1765. width := 541;
  1766. height := 311;
  1767. end;
  1768. Strings := ['General', 'Food settings', 'Potion settings', 'NPC settings', 'Loot settings', 'Prayer settings', 'Misc'];
  1769. for i := 0 to high(FormData.tabs) do
  1770. begin
  1771. FormData.Tabs[i] := TTabSheet.Create(Formdata.FightForm);
  1772. with FormData.Tabs[i] do
  1773. begin
  1774. Caption := Strings[i];
  1775. Parent := Formdata.TPage;
  1776. end;
  1777. end;
  1778. for i := 0 to high(FormData.Trim) do
  1779. begin
  1780. FormData.Trim[i] := TShape.Create(FormData.Tabs[i]);
  1781. with FormData.Trim[i] do
  1782. begin
  1783. Parent := FormData.Tabs[i];
  1784. top := 1;
  1785. left := 0;
  1786. width := 531;
  1787. height := 281;
  1788. pen.color := 5;
  1789. end;
  1790. end;
  1791. for i := 0 to high(FormData.Labels) do
  1792. begin
  1793. FormData.Labels[i] := TLabel.Create(FormData.Tabs[i]);
  1794. with FormData.Labels[i] do
  1795. begin
  1796. Caption := Strings[i];
  1797. Parent := FormData.Tabs[i];
  1798. left := 210;
  1799. top := 2;
  1800. if (i = 0) then
  1801. begin
  1802. left := 220;
  1803. top := 25;
  1804. end;
  1805. if (i = 6) then
  1806. left := 250;
  1807. Font.size := 14;
  1808. end;
  1809. end;
  1810. Positions := [Point(92, 140), Point(210, 97)];
  1811. Sizes := [Point(240, 55), Point(330, 50)];
  1812. for i := 0 to high(FormData.GPanels) do
  1813. begin
  1814. FormData.GPanels[i] := TPanel.Create(FormData.Tabs[0]);
  1815. with FormData.GPanels[i] do
  1816. begin
  1817. Parent := FormData.Tabs[0];
  1818. Top := Positions[i].x;
  1819. Left := Positions[i].y;
  1820. Width := Sizes[i].x;
  1821. Height := Sizes[i].y;
  1822. PARENTCOLOR := false;
  1823. COLOR := 15790320;
  1824. //font.color := 32768;
  1825. end;
  1826. end;
  1827. for i := 0 to high(FormData.Edits) do
  1828. begin
  1829. FormData.Edits[i] := TEdit.Create(FormData.Tabs[0]);
  1830. with FormData.Edits[i] do
  1831. begin
  1832. Parent := FormData.GPanels[0];
  1833. top := 22;
  1834. left := 9 + (i * 140);
  1835. if (i = 0) then
  1836. text := T_username;
  1837. end;
  1838. end;
  1839. Strings := ['Username', 'Password'];
  1840. for i := 0 to high(FormData.LoginLabels) do
  1841. begin
  1842. FormData.LoginLabels[i] := TLabel.Create(FormData.GPanels[0]);
  1843. with FormData.LoginLabels[i] do
  1844. begin
  1845. Parent := FormData.GPanels[0];
  1846. Caption := Strings[i];
  1847. top := 5;
  1848. left := 22 + (i * 140);
  1849. end;
  1850. end;
  1851. Strings := ['Quit', 'Update', 'Help', 'Start'];
  1852. for i := 0 to high(FormData.Buttons) do
  1853. begin
  1854. FormData.Buttons[i] := TButton.Create(FormData.GPanels[1]);
  1855. with FormData.Buttons[i] do
  1856. begin
  1857. Parent := FormData.GPanels[1];
  1858. Caption := Strings[i];
  1859. top := 12;
  1860. left := 12 + (i * 77);
  1861. OnClick := @Other;
  1862. if (i = 3) then
  1863. Onclick := @SaveForm;
  1864. if (i = 1) then
  1865. Onclick := @Update;
  1866. end;
  1867. end;
  1868. for i := 0 to high(FormData.Options) do
  1869. begin
  1870. FormData.Options[i] := TListBox.Create(FormData.Tabs[i+1]);
  1871. with FormData.Options[i] do
  1872. begin
  1873. Parent := FormData.Tabs[i+1];
  1874. visible := true;
  1875. Left := 40;
  1876. if (i = 4) then
  1877. left := 5;
  1878. Top := 60;
  1879. Width := 105;
  1880. if (i = 4) then
  1881. Width := 140;
  1882. Height := 150;
  1883. PARENTCOLOR := false;
  1884. FONT.Size := 11;
  1885. font.name := 'Times new Roman';
  1886. Onclick := @UpdateInfo;
  1887. end;
  1888. end;
  1889. for i := 0 to high(FormData.Chosen) do
  1890. begin
  1891. FormData.Chosen[i] := TListBox.Create(FormData.Tabs[i+1]);
  1892. with FormData.Chosen[i] do
  1893. begin
  1894. Parent := FormData.Tabs[i+1];
  1895. visible := true;
  1896. Left := 200;
  1897. if (i = 4) then
  1898. left:= 170;
  1899. Top := 60;
  1900. Width := 105;
  1901. if (i = 4) then
  1902. Width := 130;
  1903. Height := 150;
  1904. PARENTCOLOR := false;
  1905. FONT.Size := 11;
  1906. font.name := 'Times new Roman';
  1907. Onclick := @UpdateChosen;
  1908. end;
  1909. end;
  1910. Strings := ['Add Prayer', 'Delete Prayer'];
  1911. for i := 0 to high(FormData.PrayButtons) do
  1912. begin
  1913. FormData.PrayButtons[i] := TButton.Create(FormData.GPanels[1]);
  1914. with FormData.PrayButtons[i] do
  1915. begin
  1916. Parent := FormData.tabs[5];
  1917. Caption := Strings[i];
  1918. top := 230;
  1919. left := 12 + (i * 150);
  1920. width := 120;
  1921. OnClick := @UpdatePrayerList;
  1922. Enabled := false;
  1923. end;
  1924. end;
  1925. Strings := ['Food information', 'Potion information','NPC information','Loot information','Prayer information'];
  1926. Positions := [Point(45, 355), Point(45, 355), Point(40, 380), Point(35, 390), Point(35, 365)];
  1927. for i := 0 to high(FormData.InfoLabels) do
  1928. begin
  1929. FormData.InfoLabels[i] := TLabel.Create(FormData.Tabs[i + 1]);
  1930. with FormData.InfoLabels[i] do
  1931. begin
  1932. Parent := FormData.Tabs[i + 1];
  1933. top := Positions[i].x;
  1934. left := Positions[i].y;
  1935. font.size := 10;
  1936. font.name := 'times new roman';
  1937. Caption := Strings[i];
  1938. end;
  1939. end;
  1940. Positions := [Point(80, 330), Point(70, 313), Point(60, 350), Point(60, 340), Point(70, 305)];
  1941. Sizes := [Point(140, 90), Point(210, 130), Point(140, 180), Point(170, 140), Point(220, 140)];
  1942. for i := 0 to high(FormData.Shapes) do
  1943. begin
  1944. FormData.Shapes[i] := TShape.Create(FormData.Tabs[i+1]);
  1945. with FormData.Shapes[i] do
  1946. begin
  1947. Parent := FormData.Tabs[i+1];
  1948. top := Positions[i].x;
  1949. left := Positions[i].y;
  1950. width := Sizes[i].x;
  1951. height := Sizes[i].y;
  1952. pen.color := 0;
  1953. end;
  1954. end;
  1955. for i := 0 to high(FormData.FoodInfo) do
  1956. begin
  1957. FormData.FoodInfo[i] := TLabel.Create(FormData.Tabs[1]);
  1958. with FormData.FoodInfo[i] do
  1959. begin
  1960. Parent := FormData.Tabs[1];
  1961. top := 100 + (i * 20);
  1962. left := 370;
  1963. font.size := 11;
  1964. font.name := 'times new roman';
  1965. end;
  1966. end;
  1967. for i := 0 to high(FormData.PotionInfo) do
  1968. begin
  1969. FormData.PotionInfo[i] := TLabel.Create(FormData.Tabs[2]);
  1970. with FormData.PotionInfo[i] do
  1971. begin
  1972. Parent := FormData.Tabs[2];
  1973. top := 110 + (i * 30);
  1974. left := 330;
  1975. font.size := 11;
  1976. font.name := 'times new roman';
  1977. end;
  1978. end;
  1979. for i := 0 to high(FormData.NPCInfo) do
  1980. begin
  1981. FormData.NPCInfo[i] := TLabel.Create(FormData.Tabs[3]);
  1982. with FormData.NPCInfo[i] do
  1983. begin
  1984. Parent := FormData.Tabs[3];
  1985. top := 65 + (i * 20);
  1986. left := 375;
  1987. font.size := 11;
  1988. font.name := 'times new roman';
  1989. end;
  1990. end;
  1991. for i := 0 to high(FormData.LootInfo) do
  1992. begin
  1993. FormData.LootInfo[i] := TLabel.Create(FormData.Tabs[4]);
  1994. with FormData.LootInfo[i] do
  1995. begin
  1996. Parent := FormData.Tabs[4];
  1997. top := 80 + (i * 40);
  1998. left := 360;
  1999. font.size := 11;
  2000. end;
  2001. end;
  2002. for i := 0 to high(FormData.PrayLabels) do
  2003. begin
  2004. FormData.PrayLabels[i] := TLabel.Create(FormData.Tabs[5]);
  2005. with FormData.PrayLabels[i] do
  2006. begin
  2007. Parent := FormData.Tabs[5];
  2008. top := 80 + (i * 40);
  2009. left := 310;
  2010. font.size := 10;
  2011. end;
  2012. end;
  2013. FormData.DropList := TListBox.Create(FormData.Tabs[3]);
  2014. with FormData.DropList do
  2015. begin
  2016. Parent := FormData.Tabs[3];
  2017. top := 130;
  2018. Left := 360;
  2019. Width := 120;
  2020. Height := 100;
  2021. font.size := 10;
  2022. Visible := false;
  2023. end;
  2024. Strings := ['Add NPC', 'Delete NPC', 'Suggest NPC'];
  2025. for i := 0 to high(FormData.NPCButtons) do
  2026. begin
  2027. FormData.NPCButtons[i] := TButton.Create(FormData.Tabs[3]);
  2028. with FormData.NPCButtons[i] do
  2029. begin
  2030. Parent := FormData.Tabs[3];
  2031. Caption := Strings[i];
  2032. enabled := false;
  2033. left := 25 + (i * 100);
  2034. top := 220;
  2035. width := 90;
  2036. Onclick := @UpdateKillList;
  2037. if (i = 2) then
  2038. enabled := true;
  2039. end;
  2040. end;
  2041. Strings := ['Add loot', 'Delete Loot', 'Suggest loot'];
  2042. for i := 0 to high(FormData.LootButtons) do
  2043. begin
  2044. FormData.LootButtons[i] := TButton.Create(FormData.Tabs[4]);
  2045. with FormData.LootButtons[i] do
  2046. begin
  2047. Parent := FormData.Tabs[4];
  2048. left := 25 + (i * 105);
  2049. top := 220;
  2050. width := 95;
  2051. Caption := Strings[i];
  2052. Onclick := @UpdateLoot;
  2053. enabled := false;
  2054. if (i = 2) then
  2055. enabled := true;
  2056. end;
  2057. end;
  2058. Strings := ['Add Potion', 'Delete Potion'];
  2059. for i := 0 to high(FormData.PotionButtons) do
  2060. begin
  2061. FormData.PotionButtons[i] := TButton.Create(FormData.Tabs[2]);
  2062. with FormData.PotionButtons[i] do
  2063. begin
  2064. Parent := FormData.Tabs[2];
  2065. left := 60 + (i * 115);
  2066. top := 225;
  2067. width := 105;
  2068. Caption := Strings[i];
  2069. Onclick := @UpdatePotions;
  2070. enabled := false;
  2071. end;
  2072. end;
  2073. Strings := ['Add Food', 'Delete Food'];
  2074. for i := 0 to high(FormData.FoodButtons) do
  2075. begin
  2076. FormData.FoodButtons[i] := TButton.Create(FormData.Tabs[2]);
  2077. with FormData.FoodButtons[i] do
  2078. begin
  2079. Parent := FormData.Tabs[1];
  2080. left := 60 + (i * 115);
  2081. top := 225;
  2082. width := 105;
  2083. Caption := Strings[i];
  2084. Onclick := @UpdateFood;
  2085. enabled := false;
  2086. end;
  2087. end;
  2088. Strings := ['NPCs', 'Kill list', 'Drops'];
  2089. for i := 0 to high(FormData.NPCLabels) do
  2090. begin
  2091. FormData.NPCLabels[i] := TLabel.Create(FormData.Tabs[3]);
  2092. with FormData.NPCLabels[i] do
  2093. begin
  2094. Parent := FormData.Tabs[3];
  2095. top := 40;
  2096. left := 70 + (i * 160);
  2097. if (i = 2) then
  2098. begin
  2099. top := 110;
  2100. left := 400;
  2101. Visible := false;
  2102. end;
  2103. font.size := 11;
  2104. Caption := Strings[i];
  2105. end;
  2106. end;
  2107. Strings := ['Loot items', 'Debug mode', 'Use caskets', 'Use Prayer', 'Logout when out of prayer' , 'Use Potions', 'Log out when out of potions', 'Use food'];
  2108. for i := 0 to 3 do
  2109. begin
  2110. FormData.checkBoxes[i] := TCheckBox.create(FormData.tabs[6]);
  2111. with FormData.CheckBoxes[i] do
  2112. begin
  2113. Parent := FormData.Tabs[6];
  2114. Caption := Strings[i];
  2115. top := 50 + (i * 40);
  2116. left := 120;
  2117. end;
  2118. end;
  2119. for i := 4 to 7 do
  2120. begin
  2121. FormData.checkBoxes[i] := TCheckBox.create(FormData.tabs[6]);
  2122. with FormData.CheckBoxes[i] do
  2123. begin
  2124. Parent := FormData.Tabs[6];
  2125. Caption := Strings[i];
  2126. top := 50 + ((i-4) * 40);
  2127. left := 260;
  2128. end;
  2129. end;
  2130. FormData.PrayCombo := TComboBox.Create(FormData.Tabs[6]);
  2131. with FormData.PrayCombo do
  2132. begin
  2133. Parent := Formdata.Tabs[6];
  2134. Items.Add('Prayer Pots');
  2135. Items.Add('Restore Pots');
  2136. text := 'Prayer restore Method';
  2137. font.size := 8;
  2138. width := 140;
  2139. left := 20;
  2140. top := 230;
  2141. end;
  2142. FormData.TimeOutEdit := TEdit.Create(FormData.Tabs[6]);
  2143. with FormData.TimeOutEdit do
  2144. begin
  2145. Parent := FormData.Tabs[6];
  2146. Text := 'Combat Timeout';
  2147. left := 190;
  2148. top := 230;
  2149. width := 120;
  2150. end;
  2151. FormData.Clickdelay := TEdit.Create(FormData.Tabs[6]);
  2152. with FormData.Clickdelay do
  2153. begin
  2154. Parent := FormData.Tabs[6];
  2155. Text := 'Click delay after attack';
  2156. left := 340;
  2157. top := 230;
  2158. width := 150;
  2159. end;
  2160. for i := 0 to high(Food) do
  2161. FormData.Options[0].ITEMS.Add(Food[i].name);
  2162. for i := 0 to high(Pots) do
  2163. FormData.Options[1].ITEMS.Add(Pots[i].name);
  2164. for i := 0 to high(NPC) do
  2165. FormData.Options[2].ITEMS.Add(NPC[i].name);
  2166. for i := 0 to high(groundObject) do
  2167. FormData.Options[3].ITEMS.Add(groundObject[i].name);
  2168. for i := 0 to high(Prayer) do
  2169. FormData.Options[4].ITEMS.Add(Prayer[i].name);
  2170. end;
  2171. procedure SafeInitForm;
  2172. var
  2173. v: TVariantArray;
  2174. begin
  2175. SetLength(V, 0);
  2176. ThreadSafeCall('loadForm', v);
  2177. end;
  2178.  
  2179. procedure ShowFormModal;
  2180. begin
  2181. FormData.FightForm.ShowModal;
  2182. end;
  2183.  
  2184. procedure SafeShowFormModal;
  2185. var
  2186. v: TVariantArray;
  2187. begin
  2188. SetLength(V, 0);
  2189. ThreadSafeCall('ShowFormModal', v);
  2190. end;
  2191.  
  2192. Procedure loadVars;
  2193. begin
  2194. marktime(t);
  2195. t_DeclarePlayers;
  2196. mousespeed := 20;
  2197. AddOnTerminate('freememory');
  2198. CasketBMP := BitmapFromString(20, 12, 'meJzjsQlKjo9PS0zMSE7mdYjkdY' + 'rmdYkFIdd4PvdEPo9kPq80CKooKqoqKYEgoDhIjVN0Tno6BKFp4ff' + 'OgCLfLAiqLisDotqKCqAsxBagypL8fAiCaoEp5vfLQUZAXUBUX1UF' + 'sheo1ykaaBHQPRAnAaXQ1CMjoC4gaqypBukFetAhEqgXaBfETPx6B' + 'QLygBox9ULMBCK4Sundy6R2LJbaukBq01ygLgjCqhcuDlEjuXqGzO' + 'G1MkfXyRxaLb1/JRa9QP/C9QYWIOsF2gXUK3tio+zpLUBEmt4di+F' + '65S7skLu8C0UvJI5w6MWFBoNeAGrc6/c=');
  2199. Writeln('Loaded ' + toStr(declareObjects) + ' ground items');
  2200. Writeln('Loaded ' + toStr(declareNPCs) + ' NPCs');
  2201. Writeln('Loaded ' + toStr(declarePots) + ' Potions');
  2202. Writeln('Loaded ' + toStr(declareFood) + ' Food');
  2203. Writeln('Loaded ' + toStr(declarePrayers) + ' Prayers');
  2204. Writeln('Took ' + ToStr(TimeFromMark(t)) + ' ms to start up.');
  2205. end;
  2206.  
  2207. begin
  2208. loadVars;
  2209. if (useForm = true) then
  2210. begin
  2211. SafeInitForm;
  2212. SafeShowFormModal;
  2213. end;
  2214. if (UseForm = true) and (pressed = false) then
  2215. TerminateScript;
  2216. wait(1500);
  2217. activateclient;
  2218. t_loginPlayer;
  2219. MakeCompassNorth;
  2220. if (usePrayer = true) then
  2221. startPrayer;
  2222. if (usePots = true) then
  2223. PotUp;
  2224. repeat
  2225. if (not t_loggedin) then
  2226. begin
  2227. report('logging in');
  2228. t_loginPlayer;
  2229. t_SetangleHigh();
  2230. MakeCompassNorth;
  2231. if (usePrayer = true) then
  2232. startPrayer;
  2233. end;
  2234. if (useCasket) then
  2235. usecaskets;
  2236. if (usePots = true) then
  2237. PotUp;
  2238. fightNPCs;
  2239. until (IsKeydown(113));
  2240. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement