Guest User

Untitled

a guest
Jun 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.92 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.  
  156. boolean TO_ALTAR;
  157. boolean START = false;
  158. boolean CHECK = false;
  159. boolean TIME = true;
  160.  
  161. float xpmin;
  162. float xphours;
  163.  
  164. Obj BANK;
  165. Obj RUINS;
  166. Obj ALTAR;
  167. Obj PORTAL;
  168.  
  169. AIOGUI GUI;
  170.  
  171.  
  172. public boolean active() {
  173. return true;
  174. }
  175.  
  176. @Override
  177. public boolean onStart() {
  178. GUI = new AIOGUI();
  179. GUI.setVisible(true);
  180. START_XP = skills.getExperience(skills.SKILL_RUNECRAFTING);
  181. WHRU = ("Loading...");
  182.  
  183. return true;
  184. }
  185. public void onServerMessage(String abc) {
  186. if (abc.contains("You bind the temple")) {
  187. CHECK = true; }
  188.  
  189. }
  190.  
  191. public int loop() {
  192. switch (status) {
  193.  
  194. case 0://Start up Checks
  195. Tile myLoc = getMyPlayer().getLocation();
  196. Point a = new Point(myLoc.getX(), myLoc.getY());
  197. if (START) {
  198. if (TIME) {
  199. StartTime = System.currentTimeMillis();
  200. TIME = false; }
  201. else if (BANK_AIRS.contains(a)||BANK_MIND.contains(a)||BANK_WATER.contains(a)||
  202. BANK_EARTH.contains(a)||BANK_FIRE.contains(a)||BANK_BODY.contains(a)) {
  203. status = 1; } }
  204.  
  205.  
  206. return random(300, 500);
  207.  
  208. case 1://Banking
  209. BANK = getClosestObject(7, BANKS);
  210. if (inventory.getCount(false, ESS) > 26) {
  211. TO_ALTAR = true;
  212. status = 2; }
  213. else if (!bank.isOpen()) {
  214. if (inventory.contains(RUNES)||!inventory.contains(ESS)) {
  215. if (WHICH_RUNE == 5) {
  216. BANK.doAction("Bank"); }
  217. if (!(WHICH_RUNE == 5)) {
  218. BANK.doAction("quickly"); }
  219. sleep(800, 1200); } }
  220. else if (bank.isOpen()) {
  221. if (inventory.getCount() == 0) {
  222. bank.withdrawItem(ESS, 28);
  223. sleep(400, 650); }
  224. if (inventory.getCount() > 0 && !inventory.contains(ESS)) {
  225. bank.depositInventory();
  226. sleep(400, 700); } }
  227.  
  228.  
  229. return random(200, 300);
  230.  
  231. case 2://checking which paths to take
  232. if (walking.getEnergy() > random(30, 70)) {
  233. walking.setRunning(true); }
  234. if (WHICH_RUNE == 1) {
  235. status = 3; }
  236. if (WHICH_RUNE == 2) {
  237. status = 4; }
  238. if (WHICH_RUNE == 3) {
  239. status = 5; }
  240. if (WHICH_RUNE == 4) {
  241. status = 6; }
  242. if (WHICH_RUNE == 5) {
  243. status = 7; }
  244. if (WHICH_RUNE == 6) {
  245. status = 8; }
  246.  
  247.  
  248. return random(200, 300);
  249.  
  250. case 3://Air paths
  251. int RAN = random(1, 2);
  252. if (TO_ALTAR) {
  253. if (RAN == 1) {
  254. walking.walkPath(walking.randomizePath(AIRS1, 2, 2));
  255. status = 9; }
  256. if (RAN == 2) {
  257. walking.walkPath(walking.randomizePath(AIRS2, 2, 2));
  258. status = 9; } }
  259. if (!TO_ALTAR) {
  260. if (RAN == 1) {
  261. walking.walkPath(walking.randomizePath(RAIRS1, 2, 2));
  262. status = 0; }
  263. if (RAN == 2) {
  264. walking.walkPath(walking.randomizePath(RAIRS2, 2, 2));
  265. status = 0; } }
  266.  
  267.  
  268. return random(200, 300);
  269.  
  270. case 4://Mind paths
  271. int RAND = random(1, 2);
  272. if (TO_ALTAR) {
  273. if (RAND == 1) {
  274. walking.walkPath(walking.randomizePath(MIND1, 2, 2));
  275. status = 9; }
  276. if (RAND == 2) {
  277. walking.walkPath(walking.randomizePath(MIND2, 2, 2));
  278. status = 9; } }
  279. if (!TO_ALTAR) {
  280. if (RAND == 1) {
  281. walking.walkPath(walking.randomizePath(RMIND1, 2, 2));
  282. status = 0; }
  283. if (RAND == 2) {
  284. walking.walkPath(walking.randomizePath(RMIND2, 2, 2));
  285. status = 0; } }
  286.  
  287.  
  288. return random(200, 300);
  289.  
  290. case 5://Water paths
  291. int RANDO = random(1, 2);
  292. if (TO_ALTAR) {
  293. if (RANDO == 1) {
  294. walking.walkPath(walking.randomizePath(WATER1, 2, 2));
  295. status = 9; }
  296. if (RANDO == 2) {
  297. walking.walkPath(walking.randomizePath(WATER2, 2, 2));
  298. status = 9; } }
  299. if (!TO_ALTAR) {
  300. if (RANDO == 1) {
  301. walking.walkPath(walking.randomizePath(RWATER1, 2, 2));
  302. status = 0; }
  303. if (RANDO == 2) {
  304. walking.walkPath(walking.randomizePath(RWATER2, 2, 2));
  305. status = 0; } }
  306.  
  307.  
  308. return random(200, 300);
  309.  
  310. case 6://Earth paths
  311. int RANDOM = random(1, 2);
  312. if (TO_ALTAR) {
  313. if (RANDOM == 1) {
  314. walking.walkPath(walking.randomizePath(EARTH1, 2, 2));
  315. status = 9; }
  316. if (RANDOM == 2) {
  317. walking.walkPath(walking.randomizePath(EARTH2, 2, 2));
  318. status = 9; } }
  319. if (!TO_ALTAR) {
  320. if (RANDOM == 1) {
  321. walking.walkPath(walking.randomizePath(REARTH1, 2, 2));
  322. status = 0; }
  323. if (RANDOM == 2) {
  324. walking.walkPath(walking.randomizePath(REARTH2, 2, 2));
  325. status = 0; } }
  326.  
  327. return random(200, 300);
  328.  
  329. case 7://Fire paths
  330. int RANDOMS = random(1, 2);
  331. if (TO_ALTAR) {
  332. if (RANDOMS == 1) {
  333. walking.walkPath(walking.randomizePath(FIRE1, 2, 2));
  334. status = 9; }
  335. if (RANDOMS == 2) {
  336. walking.walkPath(walking.randomizePath(FIRE2, 2, 2));
  337. status = 9; } }
  338. if (!TO_ALTAR) {
  339. if (RANDOMS == 1) {
  340. walking.walkPath(walking.randomizePath(RFIRE1, 2, 2));
  341. status = 0; }
  342. if (RANDOMS == 2) {
  343. walking.walkPath(walking.randomizePath(RFIRE2, 2, 2));
  344. status = 0; } }
  345.  
  346. return random(200, 300);
  347.  
  348. case 8://Body paths
  349. int RANDOMs = random(1, 2);
  350. if (TO_ALTAR) {
  351. if (RANDOMs == 1) {
  352. walking.walkPath(walking.randomizePath(BODY1, 2, 2));
  353. status = 9; }
  354. if (RANDOMs == 2) {
  355. walking.walkPath(walking.randomizePath(BODY2, 2, 2));
  356. status = 9; } }
  357. if (!TO_ALTAR) {
  358. if (RANDOMs == 1) {
  359. walking.walkPath(walking.randomizePath(RBODY1, 2, 2));
  360. status = 0; }
  361. if (RANDOMs == 2) {
  362. walking.walkPath(walking.randomizePath(RBODY2, 2, 2));
  363. status = 0; } }
  364.  
  365. return random(200, 300);
  366.  
  367. case 9://enter ruins
  368. RUINS = getClosestObject(7, RUINZ);
  369. int RAN_X = random(2982, 2988);
  370. int RAN_Y = random(3290, 3294);
  371. Tile myLoca = getMyPlayer().getLocation();
  372. Point b = new Point(myLoca.getX(), myLoca.getY());
  373.  
  374. if (getMyPlayer().isMoving()) {
  375. return random(400, 600); }
  376. if (MINES.contains(b)) {
  377. walking.walkToMM(new Tile(RAN_X, RAN_Y)); }
  378. if (ALTAR_AIRS.contains(b)||ALTAR_MIND.contains(b)||ALTAR_WATER.contains(b)||
  379. ALTAR_EARTH.contains(b)||ALTAR_FIRE.contains(b)||ALTAR_BODY.contains(b)) {
  380. status = 10; }
  381. else if (RUINS_AIRS.contains(b)||RUINS_MIND.contains(b)||RUINS_WATER.contains(b)||
  382. RUINS_EARTH.contains(b)||RUINS_FIRE.contains(b)||RUINS_BODY.contains(b)) {
  383. RUINS.doAction("Enter");
  384. sleep(500, 700); }
  385.  
  386.  
  387. return random(200, 300);
  388.  
  389. case 10: //crafting runes leaving portal
  390. PORTAL = getClosestObject(20, PORTALS);
  391. ALTAR = getClosestObject(20, ALTARS);
  392. Tile myLocat = getMyPlayer().getLocation();
  393. Point c = new Point(myLocat.getX(), myLocat.getY());
  394. if (CHECK) {
  395. if (getMyPlayer().getAnimation() == -1) {
  396. int COUNT = inventory.getCount(true, RUNES);
  397. AMCR += COUNT;
  398. ESS_USED+= 28;
  399. CHECK = false; } }
  400. if (RUINS_AIRS.contains(c)||RUINS_MIND.contains(c)||RUINS_WATER.contains(c)||
  401. RUINS_EARTH.contains(c)||RUINS_FIRE.contains(c)||RUINS_BODY.contains(c)) {
  402. TO_ALTAR = false;
  403. status = 2; }
  404. if (getMyPlayer().isMoving()) {
  405. return random(400, 600); }
  406. if (getMyPlayer().getAnimation() != -1) {
  407. return random(400, 600); }
  408. else if (!(RUINS_AIRS.contains(c)||RUINS_MIND.contains(c)||RUINS_WATER.contains(c)||
  409. RUINS_EARTH.contains(c)||RUINS_FIRE.contains(c)||RUINS_BODY.contains(c))) {
  410. Tile port = PORTAL.getLocation();
  411. Tile alta = ALTAR.getLocation();
  412. if (inventory.contains(RUNES)) {
  413. if (Calculations.onScreen(getCalculations().tileToScreen(PORTAL.getLocation()))) {
  414. PORTAL.doAction("Use");
  415. sleep(400, 600);}
  416. if (!Calculations.onScreen(getCalculations().tileToScreen(PORTAL.getLocation()))) {
  417. walking.walkToMM(port); } }
  418. else if (Calculations.onScreen(getCalculations().tileToScreen(ALTAR.getLocation()))) {
  419. ALTAR.doAction("Craft");
  420. sleep(300, 500); }
  421. else if (!Calculations.onScreen(getCalculations().tileToScreen(ALTAR.getLocation()))) {
  422. walking.walkToMM(alta); } }
  423.  
  424.  
  425. return random(200, 300);
  426.  
  427. }
  428. return random(200, 300);
  429.  
  430. }
  431.  
  432. void clickMouse(int x, int y, int randx, int randy, boolean button) {
  433. mouse.moveMouse(x, y, randx, randy);
  434. sleep(100);
  435. mouse.clickMouse(button);
  436.  
  437. }
  438.  
  439.  
  440. public String getName() {
  441. return "AIO Runecrafter";
  442. }
  443.  
  444. public String getAuthor() {
  445. return "Ryan";
  446. }
  447.  
  448. public String getVersion() {
  449. return "1.11";
  450. }
  451.  
  452. public String getDescription() {
  453. return "Will craft all f2p runes";
  454. }
  455. public void onStop() {
  456. log("Run time: "+runTime);
  457. log("Xp gained: "+GAINED_XP);
  458. log("Crafting: "+WHRU);
  459. log("Crafted "+AMCR +" "+WHRU);
  460. log("Essence used: "+ESS_USED);
  461. log("XP per hour: "+xphours);
  462.  
  463. }
  464. public void onRepaint(Graphics g) {
  465. if (START) {
  466.  
  467. runTime = System.currentTimeMillis() - StartTime;
  468. int secs = ((int) ((runTime / 1000) % 60));
  469. int mins = ((int) (((runTime / 1000) / 60) % 60));
  470. int hours = ((int) ((((runTime / 1000) / 60) / 60) % 60));
  471. float xpsec = 0;
  472.  
  473. if ((mins > 0 || hours > 0 || secs > 0) && (skills.getExperience(Skills.SKILL_RUNECRAFTING) - START_XP) > 0) {
  474. xpsec = ((float) (skills.getExperience(Skills.SKILL_RUNECRAFTING) - START_XP)) / (float) (secs + (mins * 60) + (hours * 60 * 60)); }
  475.  
  476. xpmin = xpsec * 60;
  477. xphours = xpmin * 60;
  478. int x = 0;
  479. int y = 0;
  480. CUR_XP = skills.getExperience(skills.SKILL_RUNECRAFTING);
  481. GAINED_XP = CUR_XP - START_XP;
  482.  
  483. g.setColor(new Color(0, 0, 0, 100));
  484. g.fill3DRect(4, 220, 171, 118, true);
  485. g.setColor(Color.lightGray);
  486. x+=22;
  487. y+=234;
  488. g.drawString("AIO Runecrafter by "+getAuthor(), x, y);
  489. g.setColor(Color.white);
  490. x-=12;
  491. y+=20;
  492. g.drawString("Crafting: " + WHRU, x, y);
  493. y+=15;
  494. g.drawString("Run time: " + (hours < 10 ? "0" : "") + hours
  495. + ":" + (mins < 10 ? "0" : "") + mins
  496. + ":" + (secs < 10 ? "0" : "") + secs, x, y);
  497. y+=15;
  498. g.drawString("Essence used: "+ESS_USED, x, y);
  499. y+=15;
  500. g.drawString("Runes crafted: "+AMCR, x, y);
  501. y+=15;
  502. g.drawString("XP gained: "+ GAINED_XP, x, y);
  503. y+=15;
  504. g.drawString("XP per hour: "+ (int)xphours, x, y);
  505. g.setColor(Color.black);
  506. x+=370;
  507. y+=141;
  508. g.drawString("Version: " + getVersion(), x, y);
  509.  
  510.  
  511.  
  512. } }
  513. public class AIOGUI extends javax.swing.JFrame {
  514.  
  515. /** Creates new form AIOGUI */
  516. public AIOGUI() {
  517. initComponents();
  518. }
  519.  
  520. /** This method is called from within the constructor to
  521. * initialize the form.
  522. * WARNING: Do NOT modify this code. The content of this method is
  523. * always regenerated by the Form Editor.
  524. */
  525. @SuppressWarnings("unchecked")
  526. // <editor-fold defaultstate="collapsed" desc="Generated Code">
  527. private void initComponents() {
  528.  
  529. jInternalFrame1 = new javax.swing.JInternalFrame();
  530. jComboBox1 = new javax.swing.JComboBox();
  531. jLabel1 = new javax.swing.JLabel();
  532. jButton1 = new javax.swing.JButton();
  533.  
  534. jInternalFrame1.setVisible(true);
  535.  
  536. javax.swing.GroupLayout jInternalFrame1Layout = new javax.swing.GroupLayout(jInternalFrame1.getContentPane());
  537. jInternalFrame1.getContentPane().setLayout(jInternalFrame1Layout);
  538. jInternalFrame1Layout.setHorizontalGroup(
  539. jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  540. .addGap(0, 22, Short.MAX_VALUE)
  541. );
  542. jInternalFrame1Layout.setVerticalGroup(
  543. jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  544. .addGap(0, 283, Short.MAX_VALUE)
  545. );
  546.  
  547. setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
  548. setTitle("AIO Runecrafter");
  549.  
  550. jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Air Runes", "Earth Runes", "Mind Runes", "Water Runes", "Fire Runes", "Body Runes" }));
  551.  
  552. jLabel1.setText("Which Rune? ");
  553.  
  554. jButton1.setLabel("Start Script"); {
  555. jButton1.addActionListener(new java.awt.event.ActionListener() {
  556. public void actionPerformed(java.awt.event.ActionEvent evt) {
  557. startScript();
  558. } });
  559. }
  560.  
  561. javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  562. getContentPane().setLayout(layout);
  563. layout.setHorizontalGroup(
  564. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  565. .addGroup(layout.createSequentialGroup()
  566. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  567. .addGroup(layout.createSequentialGroup()
  568. .addGap(46, 46, 46)
  569. .addComponent(jLabel1)
  570. .addGap(18, 18, 18)
  571. .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE))
  572. .addGroup(layout.createSequentialGroup()
  573. .addGap(87, 87, 87)
  574. .addComponent(jButton1)))
  575. .addContainerGap(56, Short.MAX_VALUE))
  576. );
  577. layout.setVerticalGroup(
  578. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  579. .addGroup(layout.createSequentialGroup()
  580. .addGap(44, 44, 44)
  581. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  582. .addComponent(jLabel1)
  583. .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  584. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 34, Short.MAX_VALUE)
  585. .addComponent(jButton1)
  586. .addGap(24, 24, 24))
  587. );
  588.  
  589. jButton1.getAccessibleContext().setAccessibleName("Start Script");
  590.  
  591. pack();
  592. }
  593. public void startScript() {
  594. if (jComboBox1.getSelectedItem().toString().equals("Air Runes")) {
  595. WHICH_RUNE = 1;
  596. WHRU = ("Air Runes"); }
  597. if (jComboBox1.getSelectedItem().toString().equals("Mind Runes")) {
  598. WHICH_RUNE = 2;
  599. WHRU = ("Mind Runes"); }
  600. if (jComboBox1.getSelectedItem().toString().equals("Water Runes")) {
  601. WHICH_RUNE = 3;
  602. WHRU = ("Water Runes"); }
  603. if (jComboBox1.getSelectedItem().toString().equals("Earth Runes")) {
  604. WHICH_RUNE = 4;
  605. WHRU = ("Earth Runes"); }
  606. if (jComboBox1.getSelectedItem().toString().equals("Fire Runes")) {
  607. WHICH_RUNE = 5;
  608. WHRU = ("Fire Runes"); }
  609. if (jComboBox1.getSelectedItem().toString().equals("Body Runes")) {
  610. WHICH_RUNE = 6;
  611. WHRU = ("Body Runes"); }
  612. START = true;
  613. GUI.setVisible(false);
  614. }
  615. }
  616.  
  617. // Variables declaration - do not modify
  618. private javax.swing.JButton jButton1;
  619. private javax.swing.JComboBox jComboBox1;
  620. private javax.swing.JInternalFrame jInternalFrame1;
  621. private javax.swing.JLabel jLabel1;
  622. // End of variables declaration
  623.  
  624. }
Add Comment
Please, Sign In to add comment