Guest User

Untitled

a guest
Jun 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.22 KB | None | 0 0
  1. package com.scripts;
  2.  
  3. import java.awt.*;
  4.  
  5. import com.kbot2.handlers.eventSystem.eventListeners.PaintListener;
  6. import com.kbot2.handlers.eventSystem.eventListeners.ServerMessageListener;
  7. import com.kbot2.scriptable.Script;
  8. import com.kbot2.scriptable.methods.wrappers.Tile;
  9. import com.kbot2.scriptable.methods.wrappers.Obj;
  10. import com.kbot2.scriptable.methods.Calculations;
  11. import com.kbot2.scriptable.methods.data.Skills;
  12.  
  13. public class AIORunecrafter extends Script implements PaintListener, ServerMessageListener {
  14.  
  15. Tile[] AIRS1 = new Tile[]{new Tile(3013,3355), new Tile(3010,3359), new Tile(3008,3354), new Tile(3008,3349),
  16. new Tile(3008,3344), new Tile(3007,3339), new Tile(3007,3334), new Tile(3007,3329), new Tile(3007,3324),
  17. new Tile(3003,3320), new Tile(3000,3314), new Tile(2998,3309), new Tile(2997,3304), new Tile(2993,3300),
  18. new Tile(2991,3295), new Tile(2986,3294), };
  19.  
  20. Tile[] AIRS2 = new Tile[]{new Tile(3012,3355), new Tile(3009,3359), new Tile(3008,3354), new Tile(3008,3349),
  21. new Tile(3008,3344), new Tile(3007,3339), new Tile(3007,3334), new Tile(3007,3329), new Tile(3007,3324),
  22. new Tile(3002,3321), new Tile(2998,3317), new Tile(2995,3313), new Tile(2996,3308), new Tile(2996,3303),
  23. new Tile(2993,3299), new Tile(2990,3295), new Tile(2985,3294), };
  24.  
  25. Tile[] RAIRS1 = walking.reversePath(AIRS1);
  26.  
  27. Tile[] RAIRS2 = walking.reversePath(AIRS2);
  28.  
  29. Tile[] MIND1 = new Tile[]{new Tile(2946,3368), new Tile(2946,3373), new Tile(2949,3377), new Tile(2953,3381),
  30. new Tile(2958,3382), new Tile(2961,3386), new Tile(2964,3390), new Tile(2965,3395), new Tile(2965,3400),
  31. new Tile(2968,3404), new Tile(2972,3407), new Tile(2976,3411), new Tile(2979,3416), new Tile(2984,3418),
  32. new Tile(2987,3422), new Tile(2987,3428), new Tile(2983,3431), new Tile(2981,3437), new Tile(2978,3441),
  33. new Tile(2976,3446), new Tile(2976,3451), new Tile(2973,3455), new Tile(2973,3460), new Tile(2973,3465),
  34. new Tile(2972,3470), new Tile(2972,3475), new Tile(2973,3480), new Tile(2971,3485), new Tile(2973,3490),
  35. new Tile(2976,3494), new Tile(2977,3499), new Tile(2977,3504), new Tile(2979,3509), new Tile(2983,3512), };
  36.  
  37. Tile[] MIND2 = new Tile[]{new Tile(2945,3368), new Tile(2945,3373), new Tile(2949,3376), new Tile(2953,3379),
  38. new Tile(2958,3379), new Tile(2961,3384), new Tile(2962,3389), new Tile(2964,3394), new Tile(2967,3398),
  39. new Tile(2970,3402), new Tile(2972,3407), new Tile(2976,3410), new Tile(2980,3413), new Tile(2983,3417),
  40. new Tile(2987,3421), new Tile(2987,3426), new Tile(2984,3430), new Tile(2981,3434), new Tile(2980,3439),
  41. new Tile(2976,3445), new Tile(2973,3449), new Tile(2972,3454), new Tile(2972,3459), new Tile(2972,3464),
  42. new Tile(2972,3469), new Tile(2972,3474), new Tile(2969,3478), new Tile(2971,3483), new Tile(2973,3488),
  43. new Tile(2976,3492), new Tile(2977,3497), new Tile(2980,3501), new Tile(2979,3506), new Tile(2979,3511),
  44. new Tile(2984,3512), };
  45.  
  46. Tile[] RMIND1 = walking.reversePath(MIND1);
  47.  
  48. Tile[] RMIND2 = walking.reversePath(MIND2);
  49.  
  50. Tile[] WATER1 = new Tile[]{new Tile(3092,3244), new Tile(3096,3247), new Tile(3098,3242), new Tile(3101,3237),
  51. new Tile(3105,3234), new Tile(3110,3231), new Tile(3113,3227), new Tile(3115,3222), new Tile(3117,3217),
  52. new Tile(3120,3213), new Tile(3124,3209), new Tile(3128,3206), new Tile(3133,3205), new Tile(3138,3202),
  53. new Tile(3141,3198), new Tile(3146,3195), new Tile(3150,3192), new Tile(3153,3188), new Tile(3156,3183),
  54. new Tile(3159,3179), new Tile(3162,3175), new Tile(3164,3170), new Tile(3168,3166), new Tile(3172,3163),
  55. new Tile(3176,3159), new Tile(3181,3157), new Tile(3183,3163), };
  56.  
  57. Tile[] WATER2 = new Tile[]{new Tile(3092,3243), new Tile(3095,3247), new Tile(3098,3243), new Tile(3098,3238),
  58. new Tile(3098,3233), new Tile(3101,3229), new Tile(3106,3227), new Tile(3111,3225), new Tile(3114,3221),
  59. new Tile(3117,3217), new Tile(3120,3212), new Tile(3124,3208), new Tile(3129,3206), new Tile(3134,3205),
  60. new Tile(3138,3202), new Tile(3139,3197), new Tile(3141,3192), new Tile(3145,3188), new Tile(3150,3186),
  61. new Tile(3153,3182), new Tile(3155,3177), new Tile(3159,3174), new Tile(3163,3170), new Tile(3167,3167),
  62. new Tile(3172,3167), new Tile(3177,3167), new Tile(3183,3165), };
  63.  
  64. Tile[] RWATER1 = walking.reversePath(WATER1);
  65.  
  66. Tile[] RWATER2 = walking.reversePath(WATER2);
  67.  
  68. Tile[] EARTH1 = new Tile[]{new Tile(3253,3420), new Tile(3253,3425), new Tile(3257,3428), new Tile(3262,3428),
  69. new Tile(3267,3428), new Tile(3272,3429), new Tile(3275,3433), new Tile(3275,3438), new Tile(3279,3441),
  70. new Tile(3281,3446), new Tile(3281,3451), new Tile(3283,3456), new Tile(3286,3461), new Tile(3290,3465),
  71. new Tile(3295,3466), new Tile(3300,3469), new Tile(3304,3474), };
  72.  
  73. Tile[] EARTH2 = new Tile[]{new Tile(3252,3420), new Tile(3253,3425), new Tile(3257,3428), new Tile(3262,3428),
  74. new Tile(3267,3429), new Tile(3272,3429), new Tile(3275,3433), new Tile(3275,3438), new Tile(3279,3441),
  75. new Tile(3282,3445), new Tile(3284,3450), new Tile(3286,3455), new Tile(3289,3459), new Tile(3291,3464),
  76. new Tile(3296,3467), new Tile(3301,3469), new Tile(3304,3473), };
  77.  
  78. Tile[] REARTH1 = walking.reversePath(EARTH1);
  79.  
  80. Tile[] REARTH2 = walking.reversePath(EARTH2);
  81.  
  82. Tile[] FIRE1 = new Tile[]{new Tile(3383,3269), new Tile(3380,3266), new Tile(3375,3266), new Tile(3370,3266),
  83. new Tile(3365,3266), new Tile(3360,3266), new Tile(3355,3266), new Tile(3349,3266), new Tile(3344,3266),
  84. new Tile(3339,3266), new Tile(3334,3266), new Tile(3329,3266), new Tile(3325,3262), new Tile(3325,3257),
  85. new Tile(3325,3252), new Tile(3325,3247), new Tile(3324,3242), new Tile(3320,3238), new Tile(3315,3237),
  86. new Tile(3310,3235), new Tile(3309,3240), new Tile(3309,3245), new Tile(3309,3250), new Tile(3311,3255), };
  87.  
  88. Tile[] FIRE2 = new Tile[]{new Tile(3383,3269), new Tile(3379,3266), new Tile(3374,3266), new Tile(3369,3266),
  89. new Tile(3364,3266), new Tile(3359,3266), new Tile(3354,3266), new Tile(3349,3266), new Tile(3344,3266),
  90. new Tile(3339,3266), new Tile(3334,3266), new Tile(3329,3266), new Tile(3325,3262), new Tile(3325,3257),
  91. new Tile(3325,3252), new Tile(3325,3247), new Tile(3323,3242), new Tile(3319,3239), new Tile(3314,3237),
  92. new Tile(3309,3239), new Tile(3309,3244), new Tile(3308,3249), new Tile(3313,3253), };
  93.  
  94. Tile[] RFIRE1 = walking.reversePath(FIRE1);
  95.  
  96. Tile[] RFIRE2 = walking.reversePath(FIRE2);
  97.  
  98. Tile[] BODY1 = new Tile[]{new Tile(3094,3491), new Tile(3090,3488), new Tile(3095,3487), new Tile(3099,3484),
  99. new Tile(3100,3479), new Tile(3100,3474), new Tile(3099,3469), new Tile(3096,3465), new Tile(3091,3465),
  100. new Tile(3087,3462), new Tile(3082,3462), new Tile(3077,3461), new Tile(3074,3457), new Tile(3071,3453),
  101. new Tile(3071,3448), new Tile(3067,3445), new Tile(3063,3448), new Tile(3058,3450), new Tile(3055,3446), };
  102.  
  103. Tile[] BODY2 = new Tile[]{new Tile(3094,3491), new Tile(3090,3488), new Tile(3095,3486), new Tile(3098,3482),
  104. new Tile(3100,3477), new Tile(3099,3472), new Tile(3099,3467), new Tile(3094,3465), new Tile(3089,3465),
  105. new Tile(3085,3462), new Tile(3080,3462), new Tile(3075,3459), new Tile(3072,3454), new Tile(3071,3449),
  106. new Tile(3070,3444), new Tile(3066,3441), new Tile(3061,3438), new Tile(3056,3440), new Tile(3055,3445), };
  107.  
  108. Tile[] RBODY1 = walking.reversePath(BODY1);
  109.  
  110. Tile[] RBODY2 = walking.reversePath(BODY2);
  111.  
  112.  
  113. Rectangle BANK_AIRS = new Rectangle(3009, 3355, 7, 3);
  114. Rectangle BANK_MIND = new Rectangle(2943, 3368, 4, 5);
  115. Rectangle BANK_WATER = new Rectangle(3092, 3240, 3, 6);
  116. Rectangle BANK_EARTH = new Rectangle(3250, 3419, 7, 4);
  117. Rectangle BANK_FIRE = new Rectangle(3380, 3267, 5, 6);
  118. Rectangle BANK_BODY = new Rectangle(3091, 3488, 4, 7);
  119.  
  120. Rectangle RUINS_AIRS = new Rectangle(2981, 3288, 8, 8);
  121. Rectangle RUINS_MIND = new Rectangle(2978, 3511, 7, 6);
  122. Rectangle RUINS_WATER = new Rectangle(3181, 3161, 8, 7);
  123. Rectangle RUINS_EARTH = new Rectangle(3301, 3471, 8, 7);
  124. Rectangle RUINS_FIRE = new Rectangle(3309, 3251, 8, 8);
  125. Rectangle RUINS_BODY = new Rectangle(3049, 3441, 8, 8);
  126.  
  127. Rectangle ALTAR_AIRS = new Rectangle(2837, 4826, 13, 15);
  128. Rectangle ALTAR_MIND = new Rectangle(2762, 4819, 40, 35);
  129. Rectangle ALTAR_WATER = new Rectangle(3475, 4822, 25, 23);
  130. Rectangle ALTAR_EARTH = new Rectangle(2631, 4817, 51, 39);
  131. Rectangle ALTAR_FIRE = new Rectangle(2574, 4830, 20, 21);
  132. Rectangle ALTAR_BODY = new Rectangle(2507, 4831, 26, 18);
  133.  
  134. Rectangle MINES = new Rectangle (2970, 3270, 30, 17);
  135.  
  136. String WHRU;
  137.  
  138. long StartTime;
  139. long runTime;
  140.  
  141. int BANKS[] = {11758, 2213, 11402, 27663, 26972};
  142. int RUNES[] = {556, 557, 554, 555, 558, 559};
  143. int RUINZ[] = {7104, 7105, 7106, 7108, 7110, 7112, 7114};
  144. int ALTARS[] = {2478, 2479, 2480, 2481, 2482, 2483};
  145. int PORTALS[] = {2465, 2466, 2467, 2468, 2469, 2470};
  146. int ESS = 1436;
  147. int status = 0;
  148. int RUNES_CRAFTED = 0;
  149. int WHICH_RUNE = 0; // 1-Air, 2-Mind, 3-Water, 4-Earth, 5-Fire, 6-Body
  150. int START_XP = 0;
  151. int AMCR = 0;
  152. int ESS_USED = 0;
  153. int CUR_XP;
  154. int GAINED_XP;
  155. int secs = ((int) ((runTime / 1000) % 60));
  156. int mins = ((int) (((runTime / 1000) / 60) % 60));
  157. int hours = ((int) ((((runTime / 1000) / 60) / 60) % 60));
  158.  
  159. boolean TO_ALTAR;
  160. boolean START = false;
  161. boolean CHECK = false;
  162. boolean TIME = true;
  163.  
  164. float xpsec;
  165. float xpmin;
  166. float xphours;
  167.  
  168. Obj BANK;
  169. Obj RUINS;
  170. Obj ALTAR;
  171. Obj PORTAL;
  172.  
  173. AIOGUI GUI;
  174.  
  175.  
  176. public boolean active() {
  177. return true;
  178. }
  179.  
  180. @Override
  181. public boolean onStart() {
  182. GUI = new AIOGUI();
  183. GUI.setVisible(true);
  184. START_XP = skills.getExperience(skills.SKILL_RUNECRAFTING);
  185. WHRU = ("Loading...");
  186.  
  187. return true;
  188. }
  189. public void onServerMessage(String abc) {
  190. if (abc.contains("You bind the temple")) {
  191. CHECK = true; }
  192.  
  193. }
  194.  
  195. public int loop() {
  196. switch (status) {
  197.  
  198. case 0://Start up Checks
  199. Tile myLoc = getMyPlayer().getLocation();
  200. Point a = new Point(myLoc.getX(), myLoc.getY());
  201. if (START) {
  202. if (TIME) {
  203. StartTime = System.currentTimeMillis();
  204. TIME = false; }
  205. else if (BANK_AIRS.contains(a)||BANK_MIND.contains(a)||BANK_WATER.contains(a)||
  206. BANK_EARTH.contains(a)||BANK_FIRE.contains(a)||BANK_BODY.contains(a)) {
  207. status = 1; } }
  208.  
  209.  
  210. return random(300, 500);
  211.  
  212. case 1://Banking
  213. BANK = getClosestObject(7, BANKS);
  214. if (inventory.getCount(false, ESS) > 26) {
  215. TO_ALTAR = true;
  216. status = 2; }
  217. else if (!bank.isOpen()) {
  218. if (inventory.contains(RUNES)||!inventory.contains(ESS)) {
  219. if (WHICH_RUNE == 5) {
  220. BANK.doAction("Bank"); }
  221. if (!(WHICH_RUNE == 5)) {
  222. BANK.doAction("quickly"); }
  223. sleep(800, 1200); } }
  224. else if (bank.isOpen()) {
  225. if (inventory.getCount() == 0) {
  226. bank.withdrawItem(ESS, 28);
  227. sleep(400, 650); }
  228. if (inventory.getCount() > 0 && !inventory.contains(ESS)) {
  229. bank.depositInventory();
  230. sleep(400, 700); } }
  231.  
  232.  
  233. return random(200, 300);
  234.  
  235. case 2://checking which paths to take
  236. if (walking.getEnergy() > random(30, 70)) {
  237. walking.setRunning(true); }
  238. if (WHICH_RUNE == 1) {
  239. status = 3; }
  240. if (WHICH_RUNE == 2) {
  241. status = 4; }
  242. if (WHICH_RUNE == 3) {
  243. status = 5; }
  244. if (WHICH_RUNE == 4) {
  245. status = 6; }
  246. if (WHICH_RUNE == 5) {
  247. status = 7; }
  248. if (WHICH_RUNE == 6) {
  249. status = 8; }
  250.  
  251.  
  252. return random(200, 300);
  253.  
  254. case 3://Air paths
  255. int RAN = random(1, 2);
  256. if (TO_ALTAR) {
  257. if (RAN == 1) {
  258. walking.walkPath(walking.randomizePath(AIRS1, 2, 2));
  259. status = 9; }
  260. if (RAN == 2) {
  261. walking.walkPath(walking.randomizePath(AIRS2, 2, 2));
  262. status = 9; } }
  263. if (!TO_ALTAR) {
  264. if (RAN == 1) {
  265. walking.walkPath(walking.randomizePath(RAIRS1, 2, 2));
  266. status = 0; }
  267. if (RAN == 2) {
  268. walking.walkPath(walking.randomizePath(RAIRS2, 2, 2));
  269. status = 0; } }
  270.  
  271.  
  272. return random(200, 300);
  273.  
  274. case 4://Mind paths
  275. int RAND = random(1, 2);
  276. if (TO_ALTAR) {
  277. if (RAND == 1) {
  278. walking.walkPath(walking.randomizePath(MIND1, 2, 2));
  279. status = 9; }
  280. if (RAND == 2) {
  281. walking.walkPath(walking.randomizePath(MIND2, 2, 2));
  282. status = 9; } }
  283. if (!TO_ALTAR) {
  284. if (RAND == 1) {
  285. walking.walkPath(walking.randomizePath(RMIND1, 2, 2));
  286. status = 0; }
  287. if (RAND == 2) {
  288. walking.walkPath(walking.randomizePath(RMIND2, 2, 2));
  289. status = 0; } }
  290.  
  291.  
  292. return random(200, 300);
  293.  
  294. case 5://Water paths
  295. int RANDO = random(1, 2);
  296. if (TO_ALTAR) {
  297. if (RANDO == 1) {
  298. walking.walkPath(walking.randomizePath(WATER1, 2, 2));
  299. status = 9; }
  300. if (RANDO == 2) {
  301. walking.walkPath(walking.randomizePath(WATER2, 2, 2));
  302. status = 9; } }
  303. if (!TO_ALTAR) {
  304. if (RANDO == 1) {
  305. walking.walkPath(walking.randomizePath(RWATER1, 2, 2));
  306. status = 0; }
  307. if (RANDO == 2) {
  308. walking.walkPath(walking.randomizePath(RWATER2, 2, 2));
  309. status = 0; } }
  310.  
  311.  
  312. return random(200, 300);
  313.  
  314. case 6://Earth paths
  315. int RANDOM = random(1, 2);
  316. if (TO_ALTAR) {
  317. if (RANDOM == 1) {
  318. walking.walkPath(walking.randomizePath(EARTH1, 2, 2));
  319. status = 9; }
  320. if (RANDOM == 2) {
  321. walking.walkPath(walking.randomizePath(EARTH2, 2, 2));
  322. status = 9; } }
  323. if (!TO_ALTAR) {
  324. if (RANDOM == 1) {
  325. walking.walkPath(walking.randomizePath(REARTH1, 2, 2));
  326. status = 0; }
  327. if (RANDOM == 2) {
  328. walking.walkPath(walking.randomizePath(REARTH2, 2, 2));
  329. status = 0; } }
  330.  
  331. return random(200, 300);
  332.  
  333. case 7://Fire paths
  334. int RANDOMS = random(1, 2);
  335. if (TO_ALTAR) {
  336. if (RANDOMS == 1) {
  337. walking.walkPath(walking.randomizePath(FIRE1, 2, 2));
  338. status = 9; }
  339. if (RANDOMS == 2) {
  340. walking.walkPath(walking.randomizePath(FIRE2, 2, 2));
  341. status = 9; } }
  342. if (!TO_ALTAR) {
  343. if (RANDOMS == 1) {
  344. walking.walkPath(walking.randomizePath(RFIRE1, 2, 2));
  345. status = 0; }
  346. if (RANDOMS == 2) {
  347. walking.walkPath(walking.randomizePath(RFIRE2, 2, 2));
  348. status = 0; } }
  349.  
  350. return random(200, 300);
  351.  
  352. case 8://Body paths
  353. int RANDOMs = random(1, 2);
  354. if (TO_ALTAR) {
  355. if (RANDOMs == 1) {
  356. walking.walkPath(walking.randomizePath(BODY1, 2, 2));
  357. status = 9; }
  358. if (RANDOMs == 2) {
  359. walking.walkPath(walking.randomizePath(BODY2, 2, 2));
  360. status = 9; } }
  361. if (!TO_ALTAR) {
  362. if (RANDOMs == 1) {
  363. walking.walkPath(walking.randomizePath(RBODY1, 2, 2));
  364. status = 0; }
  365. if (RANDOMs == 2) {
  366. walking.walkPath(walking.randomizePath(RBODY2, 2, 2));
  367. status = 0; } }
  368.  
  369. return random(200, 300);
  370.  
  371. case 9://enter ruins
  372. RUINS = getClosestObject(7, RUINZ);
  373. int RAN_X = random(2982, 2988);
  374. int RAN_Y = random(3290, 3294);
  375. Tile myLoca = getMyPlayer().getLocation();
  376. Point b = new Point(myLoca.getX(), myLoca.getY());
  377.  
  378. if (getMyPlayer().isMoving()) {
  379. return random(400, 600); }
  380. if (MINES.contains(b)) {
  381. walking.walkToMM(new Tile(RAN_X, RAN_Y)); }
  382. if (ALTAR_AIRS.contains(b)||ALTAR_MIND.contains(b)||ALTAR_WATER.contains(b)||
  383. ALTAR_EARTH.contains(b)||ALTAR_FIRE.contains(b)||ALTAR_BODY.contains(b)) {
  384. status = 10; }
  385. else if (RUINS_AIRS.contains(b)||RUINS_MIND.contains(b)||RUINS_WATER.contains(b)||
  386. RUINS_EARTH.contains(b)||RUINS_FIRE.contains(b)||RUINS_BODY.contains(b)) {
  387. RUINS.doAction("Enter");
  388. sleep(500, 700); }
  389.  
  390.  
  391. return random(200, 300);
  392.  
  393. case 10: //crafting runes leaving portal
  394. PORTAL = getClosestObject(20, PORTALS);
  395. ALTAR = getClosestObject(20, ALTARS);
  396. Tile myLocat = getMyPlayer().getLocation();
  397. Point c = new Point(myLocat.getX(), myLocat.getY());
  398. if (CHECK) {
  399. if (getMyPlayer().getAnimation() == -1) {
  400. int COUNT = inventory.getCount(true, RUNES);
  401. AMCR += COUNT;
  402. ESS_USED+= 28;
  403. CHECK = false; } }
  404. if (RUINS_AIRS.contains(c)||RUINS_MIND.contains(c)||RUINS_WATER.contains(c)||
  405. RUINS_EARTH.contains(c)||RUINS_FIRE.contains(c)||RUINS_BODY.contains(c)) {
  406. TO_ALTAR = false;
  407. status = 2; }
  408. if (getMyPlayer().isMoving()) {
  409. return random(400, 600); }
  410. if (getMyPlayer().getAnimation() != -1) {
  411. return random(400, 600); }
  412. else if (!(RUINS_AIRS.contains(c)||RUINS_MIND.contains(c)||RUINS_WATER.contains(c)||
  413. RUINS_EARTH.contains(c)||RUINS_FIRE.contains(c)||RUINS_BODY.contains(c))) {
  414. Tile port = PORTAL.getLocation();
  415. Tile alta = ALTAR.getLocation();
  416. if (inventory.contains(RUNES)) {
  417. if (Calculations.onScreen(getCalculations().tileToScreen(PORTAL.getLocation()))) {
  418. PORTAL.doAction("Use");
  419. sleep(400, 600);}
  420. if (!Calculations.onScreen(getCalculations().tileToScreen(PORTAL.getLocation()))) {
  421. walking.walkToMM(port); } }
  422. else if (Calculations.onScreen(getCalculations().tileToScreen(ALTAR.getLocation()))) {
  423. ALTAR.doAction("Craft");
  424. sleep(300, 500); }
  425. else if (!Calculations.onScreen(getCalculations().tileToScreen(ALTAR.getLocation()))) {
  426. walking.walkToMM(alta); } }
  427.  
  428.  
  429. return random(200, 300);
  430.  
  431. }
  432. return random(200, 300);
  433.  
  434. }
  435.  
  436. void clickMouse(int x, int y, int randx, int randy, boolean button) {
  437. mouse.moveMouse(x, y, randx, randy);
  438. sleep(100);
  439. mouse.clickMouse(button);
  440.  
  441. }
  442.  
  443.  
  444. public String getName() {
  445. return "AIO Runecrafter";
  446. }
  447.  
  448. public String getAuthor() {
  449. return "Ryan";
  450. }
  451.  
  452. public String getVersion() {
  453. return "1.11";
  454. }
  455.  
  456. public String getDescription() {
  457. return "Will craft all f2p runes";
  458. }
  459. public void onStop() {
  460. log("Run time: " + (hours < 10 ? "0" : "") + hours
  461. + ":" + (mins < 10 ? "0" : "") + mins
  462. + ":" + (secs < 10 ? "0" : "") + secs);
  463. log("Xp gained: "+GAINED_XP);
  464. log("Crafting: "+WHRU);
  465. log("Crafted "+AMCR +" "+WHRU);
  466. log("Essence used: "+ESS_USED);
  467. log("XP per hour: "+xphours);
  468.  
  469. }
  470. public void onRepaint(Graphics g) {
  471. if (START) {
  472.  
  473. runTime = System.currentTimeMillis() - StartTime;
  474. secs = ((int) ((runTime / 1000) % 60));
  475. mins = ((int) (((runTime / 1000) / 60) % 60));
  476. hours = ((int) ((((runTime / 1000) / 60) / 60) % 60));
  477. xpsec = 0;
  478.  
  479. if ((mins > 0 || hours > 0 || secs > 0) && (skills.getExperience(Skills.SKILL_RUNECRAFTING) - START_XP) > 0) {
  480. xpsec = ((float) (skills.getExperience(Skills.SKILL_RUNECRAFTING) - START_XP)) / (float) (secs + (mins * 60) + (hours * 60 * 60)); }
  481.  
  482. xpmin = xpsec * 60;
  483. xphours = xpmin * 60;
  484. int x = 0;
  485. int y = 0;
  486. CUR_XP = skills.getExperience(skills.SKILL_RUNECRAFTING);
  487. GAINED_XP = CUR_XP - START_XP;
  488.  
  489. g.setColor(new Color(0, 0, 0, 100));
  490. g.fill3DRect(4, 220, 171, 118, true);
  491. g.setColor(Color.lightGray);
  492. x+=22;
  493. y+=234;
  494. g.drawString("AIO Runecrafter by "+getAuthor(), x, y);
  495. g.setColor(Color.white);
  496. x-=12;
  497. y+=20;
  498. g.drawString("Crafting: " + WHRU, x, y);
  499. y+=15;
  500. g.drawString("Run time: " + (hours < 10 ? "0" : "") + hours
  501. + ":" + (mins < 10 ? "0" : "") + mins
  502. + ":" + (secs < 10 ? "0" : "") + secs, x, y);
  503. y+=15;
  504. g.drawString("Essence used: "+ESS_USED, x, y);
  505. y+=15;
  506. g.drawString("Runes crafted: "+AMCR, x, y);
  507. y+=15;
  508. g.drawString("XP gained: "+ GAINED_XP, x, y);
  509. y+=15;
  510. g.drawString("XP per hour: "+ (int)xphours, x, y);
  511. g.setColor(Color.black);
  512. x+=370;
  513. y+=141;
  514. g.drawString("Version: " + getVersion(), x, y);
  515.  
  516.  
  517.  
  518. } }
  519. public class AIOGUI extends javax.swing.JFrame {
  520.  
  521. /** Creates new form AIOGUI */
  522. public AIOGUI() {
  523. initComponents();
  524. }
  525.  
  526. /** This method is called from within the constructor to
  527. * initialize the form.
  528. * WARNING: Do NOT modify this code. The content of this method is
  529. * always regenerated by the Form Editor.
  530. */
  531. @SuppressWarnings("unchecked")
  532. // <editor-fold defaultstate="collapsed" desc="Generated Code">
  533. private void initComponents() {
  534.  
  535. jInternalFrame1 = new javax.swing.JInternalFrame();
  536. jComboBox1 = new javax.swing.JComboBox();
  537. jLabel1 = new javax.swing.JLabel();
  538. jButton1 = new javax.swing.JButton();
  539.  
  540. jInternalFrame1.setVisible(true);
  541.  
  542. javax.swing.GroupLayout jInternalFrame1Layout = new javax.swing.GroupLayout(jInternalFrame1.getContentPane());
  543. jInternalFrame1.getContentPane().setLayout(jInternalFrame1Layout);
  544. jInternalFrame1Layout.setHorizontalGroup(
  545. jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  546. .addGap(0, 22, Short.MAX_VALUE)
  547. );
  548. jInternalFrame1Layout.setVerticalGroup(
  549. jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  550. .addGap(0, 283, Short.MAX_VALUE)
  551. );
  552.  
  553. setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
  554. setTitle("AIO Runecrafter");
  555.  
  556. jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Air Runes", "Earth Runes", "Mind Runes", "Water Runes", "Fire Runes", "Body Runes" }));
  557.  
  558. jLabel1.setText("Which Rune? ");
  559.  
  560. jButton1.setLabel("Start Script"); {
  561. jButton1.addActionListener(new java.awt.event.ActionListener() {
  562. public void actionPerformed(java.awt.event.ActionEvent evt) {
  563. startScript();
  564. } });
  565. }
  566.  
  567. javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  568. getContentPane().setLayout(layout);
  569. layout.setHorizontalGroup(
  570. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  571. .addGroup(layout.createSequentialGroup()
  572. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  573. .addGroup(layout.createSequentialGroup()
  574. .addGap(46, 46, 46)
  575. .addComponent(jLabel1)
  576. .addGap(18, 18, 18)
  577. .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE))
  578. .addGroup(layout.createSequentialGroup()
  579. .addGap(87, 87, 87)
  580. .addComponent(jButton1)))
  581. .addContainerGap(56, Short.MAX_VALUE))
  582. );
  583. layout.setVerticalGroup(
  584. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  585. .addGroup(layout.createSequentialGroup()
  586. .addGap(44, 44, 44)
  587. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  588. .addComponent(jLabel1)
  589. .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  590. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 34, Short.MAX_VALUE)
  591. .addComponent(jButton1)
  592. .addGap(24, 24, 24))
  593. );
  594.  
  595. jButton1.getAccessibleContext().setAccessibleName("Start Script");
  596.  
  597. pack();
  598. }
  599. public void startScript() {
  600. if (jComboBox1.getSelectedItem().toString().equals("Air Runes")) {
  601. WHICH_RUNE = 1;
  602. WHRU = ("Air Runes"); }
  603. if (jComboBox1.getSelectedItem().toString().equals("Mind Runes")) {
  604. WHICH_RUNE = 2;
  605. WHRU = ("Mind Runes"); }
  606. if (jComboBox1.getSelectedItem().toString().equals("Water Runes")) {
  607. WHICH_RUNE = 3;
  608. WHRU = ("Water Runes"); }
  609. if (jComboBox1.getSelectedItem().toString().equals("Earth Runes")) {
  610. WHICH_RUNE = 4;
  611. WHRU = ("Earth Runes"); }
  612. if (jComboBox1.getSelectedItem().toString().equals("Fire Runes")) {
  613. WHICH_RUNE = 5;
  614. WHRU = ("Fire Runes"); }
  615. if (jComboBox1.getSelectedItem().toString().equals("Body Runes")) {
  616. WHICH_RUNE = 6;
  617. WHRU = ("Body Runes"); }
  618. START = true;
  619. GUI.setVisible(false);
  620. }
  621. }
  622.  
  623. // Variables declaration - do not modify
  624. private javax.swing.JButton jButton1;
  625. private javax.swing.JComboBox jComboBox1;
  626. private javax.swing.JInternalFrame jInternalFrame1;
  627. private javax.swing.JLabel jLabel1;
  628. // End of variables declaration
  629.  
  630. }
Add Comment
Please, Sign In to add comment