Guest User

Untitled

a guest
Dec 11th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 56.42 KB | None | 0 0
  1.  
  2. import java.awt.Color;
  3. import java.awt.Graphics;
  4. import java.util.ArrayList;
  5. import org.rsbot.event.events.ServerMessageEvent;
  6. import org.rsbot.event.listeners.PaintListener;
  7. import org.rsbot.event.listeners.ServerMessageListener;
  8. import org.rsbot.script.Script;
  9. import org.rsbot.script.ScriptManifest;
  10. import org.rsbot.script.methods.Skills;
  11. import org.rsbot.script.util.Filter;
  12. import org.rsbot.script.util.Timer;
  13. import org.rsbot.script.util.WindowUtil;
  14. import org.rsbot.script.wrappers.RSCharacter;
  15. import org.rsbot.script.wrappers.RSComponent;
  16. import org.rsbot.script.wrappers.RSGroundItem;
  17. import org.rsbot.script.wrappers.RSNPC;
  18. import org.rsbot.script.wrappers.RSObject;
  19. import org.rsbot.script.wrappers.RSTile;
  20.  
  21. @ScriptManifest(authors = "REdubbledD", name = "Ownageful GDK", version = 3.8, description = "Settings in GUI.")
  22. public class OwnagefulGDK extends Script implements PaintListener, ServerMessageListener {
  23.  
  24. public double version = 3.6;
  25. private boolean startScript;
  26. boolean useSupers = false;
  27. RSComponent i;
  28. boolean useAnti = false;
  29. boolean eat = false;
  30. public int food = 7946;
  31. int withdraw;
  32. boolean ntele = false;
  33. boolean pstr, pdef, patt, panti, potted = false;
  34. int[] drags = {4677, 941, 4678};
  35. int[] geBoundry = {3182, 3433, 3189, 3446};
  36. int[] ditchBoundry = {3135, 3515, 3140, 3520};
  37. int[] wildBoundry = {3134, 3523, 3171, 3566};
  38. int[] dung1Boundry = {3290, 5472, 3304, 5480};
  39. int[] dungBoundry = {3284, 5462, 3296, 5471};
  40. int[] dungANTBoundry = {3298, 5483, 3304, 5487};
  41. int[] dungPOISONBoundry = {3282, 5473, 3286, 5475};
  42. int[] dBoundry = {3299, 5442, 3322, 5470};
  43. int[] nw = {3299, 5456, 3311, 5470};
  44. int[] sw = {3299, 5443, 3309, 5455};
  45. int[] ne = {3311, 5452, 3322, 5464};
  46. int[] se = {3311, 5442, 3322, 5451};
  47. int[] loot = {536, 1753};
  48. public RSTile[] toRope = new RSTile[]{new RSTile(3140, 3530), new RSTile(3147, 3538), new RSTile(3155, 3546), new RSTile(3161, 3554), new RSTile(3164, 3562)};
  49. public RSTile[] toPort = {new RSTile(3293, 5470), new RSTile(3289, 5462)};
  50. public RSTile[] toGE = {new RSTile(3199, 3429), new RSTile(3188, 3435)};
  51. public RSTile[] toDitch = {new RSTile(3183, 3448), new RSTile(3171, 3456), new RSTile(3156, 3463), new RSTile(3141, 3466), new RSTile(3134, 3478), new RSTile(3136, 3492), new RSTile(3136, 3506), new RSTile(3138, 3520)};
  52. int holeAnim = 2599;
  53. int ditchAnim = 6132;
  54. public int ditch = 1440;
  55. public int hole = 9312;
  56. public int rope = 28892;
  57. public RSTile portal = new RSTile(3290, 5463);
  58. final int[] strengthPots = {2440, 157, 159, 161};
  59. final int[] defencePots = {2443, 2442, 168, 167, 166, 165, 164, 163};
  60. final int[] attackPots = {2436, 145, 147, 149};
  61. final int[] antiPots = {2452, 2454, 2456, 2458};
  62. public int vTabs = 8007;
  63. RSNPC banker;
  64. private boolean nanti;
  65. Timer tse = new Timer(0);
  66. Timer tsw = new Timer(0);
  67. Timer tne = new Timer(0);
  68. Timer tnw = new Timer(0);
  69. public int rTime;
  70. String status;
  71. RSNPC[] gd;
  72. int[] loots = {536, 1753, 534};
  73. String[] names = {"Dragon bones", "Green dragonhide", "Babydragon bones"};
  74. int[] prices = new int[2];
  75. public int[] charms = {12158, 12159, 12160, 12161, 12162, 12163, 12164, 12165, 12166, 12167};
  76. public int[] drop = {229, 995, 1355, 1069, 555, 1179};
  77. int hAmount = 0;
  78. int bAmount = 0;
  79. int profit;
  80. private long runTime;
  81. private long seconds;
  82. private long minutes;
  83. private long hours;
  84. private double profitPerSecond;
  85. private int totalLoot;
  86. public int startSTR, startDEF, startHP, startATT, startMAG, startRNG,
  87. STRPH, DEFPH, HPPH, ATTPH, RNGPH, MAGPH, STRpr, DEFpr, HPpr, ATTpr,
  88. RNGpr, MAGpr, currentSTR, currentDEF, currentHP, currentATT,
  89. currentMAG, currentRNG, currentSTRLVL, currentRNGLVL,
  90. currentMAGLVL, currentDEFLVL, currentHPLVL, currentATTLVL;
  91. public boolean usingFood = true;
  92. private boolean paintSTR = false;
  93. private boolean paintATT = false;
  94. private boolean paintDEF = false;
  95. private boolean paintHP = false;
  96. private boolean paintRNG = false;
  97. private boolean paintMAG = false;
  98. private long initialStartTime;
  99. private int bankRuns;
  100. private GDK gui;
  101. int hp;
  102. RSGroundItem charmz;
  103. RSGroundItem lootz;
  104. RSGroundItem lootzd;
  105. boolean lCharms = false;
  106. boolean tabTaken;
  107. int tab;
  108. public int startBone, totalBone, ivenBone;
  109. public int startHide, totalHide, ivenHide;
  110. public int startbaby, totalbaby, ivenbaby;
  111. final Filter<RSNPC> DRAG_FILTER = new Filter<RSNPC>() {
  112.  
  113. public boolean accept(RSNPC npc) {
  114. if (!npc.isOnScreen()) {
  115. return false;
  116. }
  117. final int npcID = npc.getID();
  118. for (int x = 0; x < drags.length; x++) {
  119. if (npcID == drags[x]) {
  120. return true;
  121. }
  122. }
  123. return false;
  124. }
  125. };
  126.  
  127. @Override
  128. public boolean onStart() {
  129. initialStartTime = System.currentTimeMillis();
  130. if (game.isLoggedIn()) {
  131. startSTR = skills.getCurrentExp(Skills.STRENGTH);
  132. startDEF = skills.getCurrentExp(Skills.DEFENSE);
  133. startHP = skills.getCurrentExp(Skills.CONSTITUTION);
  134. startATT = skills.getCurrentExp(Skills.ATTACK);
  135. startRNG = skills.getCurrentExp(Skills.RANGE);
  136. startMAG = skills.getCurrentExp(Skills.MAGIC);
  137. gui = new GDK();
  138. try {
  139. String rTimeTemp = WindowUtil.showInputDialog("Approximate Respawn Time (in milliseconds*) \n *1000 milliseconds = 1 second");
  140. if (rTimeTemp != null) {
  141. rTime = Integer.parseInt(rTimeTemp);
  142. } else {
  143. rTime = 32000;
  144. }
  145. } catch (NumberFormatException numberFormatException) {
  146. rTime = 32000;
  147. } catch (StringIndexOutOfBoundsException s) {
  148. rTime = 32000;
  149. }
  150. rTime = rTime + 5000;
  151. gui.setVisible(true);
  152.  
  153. while (!startScript) {
  154. sleep(10);
  155. }
  156. log("wait for price");
  157. for (int b = 0; b < 1; b++) {
  158. prices[b] = grandExchange.lookup(loots[b]).getGuidePrice();
  159. }
  160. mouse.setSpeed(random(5, 6));
  161. ivenBone = inventory.getCount(loots[0]);
  162. log("Set initial Bone: " + ivenBone);
  163. ivenHide = inventory.getCount(loots[1]);
  164. log("Set initial Hide: " + ivenHide);
  165. ivenbaby = inventory.getCount(loots[1]);
  166. log("Set initial baby: " + ivenbaby);
  167. return true;
  168. } else {
  169. log("Please log in first.");
  170. return false;
  171. }
  172.  
  173. }
  174.  
  175. @Override
  176. public int loop() {
  177.  
  178.  
  179. for (int i = 0; i < drop.length; i++) {
  180. if (inventory.contains(drop[i])) {
  181. inventory.getItem(drop[i]).doAction("Drop");
  182. }
  183. }
  184.  
  185. if (!lCharms) {
  186. if (inventory.containsOneOf(charms)) {
  187. inventory.getItem(charms).doAction("Drop");
  188. }
  189. }
  190.  
  191.  
  192. camera.setPitch(true);
  193. if (walking.getEnergy() > random(19, 40)) {
  194. walking.setRun(true);
  195. }
  196. if (ntele) {
  197. inventory.getItem(vTabs).doAction("Break");
  198. sleep(random(7000, 8500));
  199. walking.walkTileMM(new RSTile(3208, 3435));
  200. sleep(1500, 3000);
  201. ntele = false;
  202. }
  203. if (game.isLoggedIn()) {
  204. if (getMyPlayer().getHPPercent() < hp && !isInArea(dBoundry) && getMyPlayer().isInCombat()) {
  205. if (isInArea(dungANTBoundry) || isInArea(dungPOISONBoundry) || isInArea(dung1Boundry) || isInArea(dungBoundry)) {
  206. sleep(random(100, 200));
  207. if (getMyPlayer().getHPPercent() <= hp) {
  208. inventory.getItem(vTabs).doAction("Break");
  209. sleep(random(7000, 8500));
  210. walking.walkTileMM(new RSTile(3208, 3435));
  211. sleep(1500, 3000);
  212. patt = false;
  213. pstr = false;
  214. pdef = false;
  215. panti = false;
  216. }
  217. } else {
  218. sleep(random(2000, 3000));
  219. if (inventory.contains(food)) {
  220. inventory.getItem(food).doAction("Eat");
  221. sleep(random(600, 700));
  222. } else {
  223. inventory.getItem(vTabs).doAction("Break");
  224. sleep(random(7000, 8500));
  225. walking.walkTileMM(new RSTile(3208, 3435));
  226. sleep(1500, 3000);
  227. }
  228. patt = false;
  229. pstr = false;
  230. pdef = false;
  231. panti = false;
  232. }
  233. }
  234. }
  235.  
  236. if (isInArea(geBoundry)) {
  237. if (!patt || !pstr || !pdef || !panti) {
  238. status = "Banking";
  239. banker = npcs.getNearest(5912);
  240. if (banker != null) {
  241. if (banker.isOnScreen()) {
  242. if (!bank.isOpen()) {
  243. bank.open();
  244. } else {
  245. if (!tabTaken) {
  246. sleep(random(4000, 5000));
  247. tab = bank.getCurrentTab();
  248. log("Current tab is" + tab);
  249.  
  250. tabTaken = true;
  251. startBone = bank.getCount(loots[0]);
  252. startHide = bank.getCount(loots[1]);
  253. startbaby = bank.getCount(loots[0]);
  254. // startHide = bank.getCount(loots[1]);
  255.  
  256. } else {
  257. if (bank.getCurrentTab() != tab) {
  258. openBankTab(tab);
  259. sleep(random(2000, 3000));
  260. }
  261. }
  262.  
  263. if (bank.depositAllExcept(vTabs)) {
  264. totalBone = bank.getCount(loots[0]) - startBone - ivenBone;
  265. totalHide = bank.getCount(loots[1]) - startHide - ivenHide;
  266. totalbaby = bank.getCount(loots[0]) - startbaby - ivenbaby;
  267. ivenBone = 0;
  268. ivenHide = 0;
  269. ivenbaby = 0;
  270. sleep(random(1000, 2000));
  271. if (eat && bank.isOpen()) {
  272. while (!inventory.contains(food)) {
  273. if (bank.getCurrentTab() != tab) {
  274. openBankTab(tab);
  275. sleep(random(2000, 3000));
  276. }
  277. bank.withdraw(food, withdraw);
  278. sleep(random(800, 1000));
  279. }
  280. }
  281. if (useSupers) {
  282. if (!pstr) {
  283. bank.withdraw(gap(strengthPots), 1);
  284. sleep(random(800, 1000));
  285.  
  286. }
  287. if (!patt) {
  288. bank.withdraw(gap(attackPots), 1);
  289. sleep(random(800, 1000));
  290. }
  291. if (!pdef) {
  292. bank.withdraw(gap(defencePots), 1);
  293. sleep(random(800, 1000));
  294. }
  295.  
  296. } else {
  297. patt = true;
  298. pstr = true;
  299. pdef = true;
  300. }
  301. if (useAnti) {
  302. if (!panti) {
  303. bank.withdraw(gap(antiPots), 1);
  304. sleep(random(800, 1000));
  305. }
  306. } else {
  307. panti = true;
  308. }
  309.  
  310. if (bank.close()) {
  311. sleep(random(600, 700));
  312. if (useSupers) {
  313. if (didPot(strengthPots)) {
  314. sleep(random(800, 1000));
  315. }
  316. pstr = true;
  317. if (didPot(attackPots)) {
  318. sleep(random(800, 1000));
  319. }
  320. pdef = true;
  321. if (didPot(defencePots)) {
  322. sleep(random(800, 1000));
  323. }
  324. patt = true;
  325. }
  326. if (useAnti) {
  327. if (didPot(antiPots)) {
  328. nanti = false;
  329. sleep(random(800, 1000));
  330. }
  331. panti = true;
  332. } else {
  333. nanti = false;
  334. }
  335. if (pdef && pstr && patt && panti) {
  336. if (useAnti || useSupers) {
  337. if (bank.open()) {
  338. while (!bank.getInterface().isValid()) {
  339. sleep(random(1500, 2000));
  340. bank.open();
  341. }
  342. }
  343. if (bank.isOpen()) {
  344. if (!inventory.containsOneOf(antiPots[0], antiPots[1], antiPots[2], antiPots[3]) && useAnti) {
  345. bank.depositAllExcept(vTabs, food);
  346.  
  347. if (bank.getCurrentTab() != tab) {
  348. if (i != null) {
  349. mouse.click(i.getComponent(tab).doAction("View"));
  350. }
  351. sleep(random(1000, 1800));
  352. }
  353. bank.withdraw(gap(antiPots), 1);
  354. sleep(random(500, 600));
  355. } else {
  356. bank.depositAllExcept(vTabs, food, antiPots[0], antiPots[1], antiPots[2], antiPots[3]);
  357. sleep(random(500, 600));
  358. }
  359. }
  360. }
  361. }
  362. }
  363. }
  364. }
  365. } else {
  366. walking.walkTileMM(new RSTile(3162, 3487));
  367. sleep(1500, 3000);
  368. }
  369. }
  370. } else {
  371. if (bank.isOpen()) {
  372. bank.close();
  373.  
  374. sleep(random(500, 1000));
  375. } else {
  376. while (!isInArea(ditchBoundry)) {
  377. walkPath(toDitch);
  378. }
  379. }
  380. }
  381. } else if (isInArea(ditchBoundry)) {
  382. status = "Crossing ditch.";
  383. antiban();
  384. RSObject dich = objects.getNearest(ditch);
  385. if (dich != null) {
  386. if (calc.tileOnScreen(dich.getLocation())) {
  387. dich.doAction("Cross");
  388. sleep(random(1500, 2000));
  389. } else {
  390. walking.walkTileMM(dich.getLocation());
  391. sleep(1000, 1200);
  392. }
  393. }
  394. } else if (isInArea(wildBoundry)) {
  395. antiban();
  396. try {
  397. if (interfaces.get(676) != null) {
  398. if (interfaces.get(676).getComponent(17).containsText("Proceed")) {
  399. interfaces.get(676).getComponent(17).doClick();
  400. sleep(random(200, 300));
  401. }
  402. if (getMyPlayer().getInteracting() != null) {
  403. RSCharacter npc1 = getMyPlayer().getInteracting();
  404. if (npc1 != null) {
  405. npc1.doAction("Attack");
  406. sleep(random(4000, 5000));
  407. }
  408. }
  409. }
  410. } catch (NullPointerException e) {
  411. // null
  412. }
  413. status = "Walking to tunnel.";
  414. RSObject ropez = objects.getNearest(rope);
  415. if (ropez != null) {
  416. if (calc.tileOnScreen(ropez.getLocation())) {
  417. ropez.doAction("Enter");
  418. sleep(1500, 1600);
  419. } else {
  420. walkPath(toRope);
  421. walking.walkTileMM(ropez.getLocation());
  422. }
  423. } else {
  424. walkPath(toRope);
  425. }
  426. } else if (isInArea(dung1Boundry)) {
  427. antiban();
  428. status = "Walking to portal";
  429. doPort();
  430. } else if (isInArea(dungBoundry)) {
  431. antiban();
  432. status = "Walking to portal";
  433. doPort();
  434. } else if (isInArea(dBoundry)) {
  435. status = "Fighting drags";
  436. if (fight() == 101) {
  437. patt = false;
  438. pstr = false;
  439. pdef = false;
  440. panti = false;
  441. }
  442. } else {
  443. status = "Walking to G.E";
  444. walkPath(toGE);
  445. }
  446. return 100;
  447. }
  448.  
  449. private boolean isInArea(int[] xy) {
  450. final int x = getMyPlayer().getLocation().getX();
  451. final int y = getMyPlayer().getLocation().getY();
  452. if (x >= xy[0] && x <= xy[2] && y >= xy[1] && y <= xy[3]) {
  453. return true;
  454. } else {
  455. return false;
  456.  
  457. }
  458. }
  459.  
  460. public boolean openBankTab(int tab) {
  461. if (!bank.isOpen() || (63 - (tab * 2) < 47)) {
  462. return false;
  463. }
  464. try {
  465. return bank.getInterface().getComponent(63 - (tab * 2)).doClick();
  466. } catch (NullPointerException e) {
  467. return false;
  468. }
  469. }
  470.  
  471. private boolean npcIsInArea(int[] xy, RSCharacter npc) {
  472. try {
  473. final int x = npc.getLocation().getX();
  474. final int y = npc.getLocation().getY();
  475. if (x >= xy[0] && x <= xy[2] && y >= xy[1] && y <= xy[3]) {
  476. return true;
  477. } else {
  478. return false;
  479.  
  480. }
  481. } catch (NullPointerException e) {
  482. return false;
  483. }
  484. }
  485.  
  486. private boolean itemIsInArea(int[] xy, RSGroundItem t) {
  487. try {
  488. final int x = t.getLocation().getX();
  489. final int y = t.getLocation().getY();
  490. if (x >= xy[0] && x <= xy[2] && y >= xy[1] && y <= xy[3]) {
  491. return true;
  492. } else {
  493. return false;
  494. }
  495. } catch (NullPointerException e) {
  496. return false;
  497. }
  498. }
  499.  
  500. public int gap(int[] pots) {
  501. if (bank.isOpen()) {
  502. if (bank.getCount(pots[0]) > 0) {
  503. return pots[0];
  504. } else if (bank.getCount(pots[1]) > 0) {
  505. return pots[1];
  506. } else if (bank.getCount(pots[2]) > 0) {
  507. return pots[2];
  508. } else if (bank.getCount(pots[3]) > 0) {
  509. return pots[3];
  510. }
  511. } else {
  512. return 0;
  513. }
  514. return 0;
  515. }
  516.  
  517. public boolean didPot(int[] pots) {
  518. if (inventory.containsOneOf(pots)) {
  519. if (inventory.getItem(pots).doAction("Drink")) {
  520. return true;
  521. }
  522. }
  523. return false;
  524. }
  525.  
  526. private boolean walkPath(RSTile[] path) {
  527. if (!getMyPlayer().isMoving() || calc.distanceTo(walking.getDestination()) <= 1) {
  528. return walking.walkPathMM(path);
  529. } else {
  530. if (usingFood) {
  531. while (getMyPlayer().getHPPercent() <= 85 && inventory.contains(food)) {
  532. inventory.getItem(food).doAction("Eat");
  533. }
  534.  
  535. }
  536. }
  537. return false;
  538. }
  539.  
  540. public void onRepaint(Graphics g) {
  541. if (game.isLoggedIn()) {
  542. totalLoot = ((totalBone + inventory.getCount(loots[0]) - ivenBone) * prices[0]
  543. + (totalHide + inventory.getCount(loots[1]) - ivenHide * prices[1]));
  544. g.setFont(new java.awt.Font("Tahoma", 1, 10));
  545. runTime = System.currentTimeMillis() - initialStartTime;
  546. seconds = runTime / 1000;
  547. if (seconds >= 60) {
  548. minutes = seconds / 60;
  549. seconds -= (minutes * 60);
  550. }
  551. if (minutes >= 60) {
  552. hours = minutes / 60;
  553. minutes -= (hours * 60);
  554. }
  555.  
  556. double h = (3600 * hours) + (60 * minutes) + seconds;
  557. profitPerSecond = totalLoot / h;
  558. if (!paintSTR) {
  559. currentSTR = skills.getCurrentExp(Skills.STRENGTH) - startSTR;
  560. if (currentSTR > 0) {
  561. paintSTR = true;
  562. }
  563. } else {
  564. currentSTR = skills.getCurrentExp(Skills.STRENGTH) - startSTR;
  565. float STRXPperSec = 0;
  566. if ((minutes > 0 || hours > 0 || seconds > 0) && currentSTR > 0) {
  567. STRXPperSec = ((float) currentSTR) / (float) (seconds + (minutes * 60) + (hours * 60 * 60));
  568.  
  569. }
  570. float STRXPperMin = STRXPperSec * 60;
  571. float STRXPperHour = STRXPperMin * 60;
  572. currentSTRLVL = skills.getRealLevel(Skills.STRENGTH);
  573. STRpr = skills.getPercentToNextLevel(Skills.STRENGTH);
  574. g.setColor(new Color(255, 102, 0));
  575. g.fill3DRect(187, 290, 329, 13, true);
  576. g.setColor(Color.WHITE);
  577. g.setFont(new java.awt.Font("Tahoma", 1, 10));
  578. g.drawString(" Level: " + currentSTRLVL + " " + " Xp Gained: " + currentSTR + " " + "Xp/Hour: " + (int) STRXPperHour + " " + STRpr + "%.", 190, (300));
  579. }
  580. if (!paintDEF) {
  581. currentDEF = skills.getCurrentExp(Skills.DEFENSE) - startDEF;
  582. if (currentDEF > 0) {
  583. paintDEF = true;
  584. }
  585. } else {
  586. currentDEF = skills.getCurrentExp(Skills.DEFENSE) - startDEF;
  587. float DEFXPperSec = 0;
  588. if ((minutes > 0 || hours > 0 || seconds > 0) && currentDEF > 0) {
  589. DEFXPperSec = ((float) currentDEF) / (float) (seconds + (minutes * 60) + (hours * 60 * 60));
  590. }
  591. float DEFXPperMin = DEFXPperSec * 60;
  592. float DEFXPperHour = DEFXPperMin * 60;
  593. currentDEFLVL = skills.getRealLevel(Skills.DEFENSE);
  594. DEFpr = skills.getPercentToNextLevel(Skills.DEFENSE);
  595. g.setColor(new Color(102, 102, 255));
  596. g.fill3DRect(187, 302, 329, 13, true);
  597. g.setColor(Color.WHITE);
  598. g.setFont(new java.awt.Font("Tahoma", 1, 10));
  599. g.drawString(" Level: " + currentDEFLVL + " " + " Xp Gained: " + currentDEF + " " + "Xp/Hour: " + (int) DEFXPperHour + " " + DEFpr + "%.", 190, (312));
  600. }
  601. if (!paintHP) {
  602. currentHP = skills.getCurrentExp(Skills.CONSTITUTION) - startHP;
  603. if (currentHP > 0) {
  604. paintHP = true;
  605. }
  606. } else {
  607. currentHP = skills.getCurrentExp(Skills.CONSTITUTION) - startHP;
  608. float HPXPperSec = 0;
  609. if ((minutes > 0 || hours > 0 || seconds > 0) && currentHP > 0) {
  610. HPXPperSec = ((float) currentHP) / (float) (seconds + (minutes * 60) + (hours * 60 * 60));
  611.  
  612. }
  613. float HPXPperMin = HPXPperSec * 60;
  614. float HPXPperHour = HPXPperMin * 60;
  615. currentHPLVL = skills.getRealLevel(Skills.CONSTITUTION);
  616. HPpr = skills.getPercentToNextLevel(Skills.CONSTITUTION);
  617. g.setColor(new Color(255, 0, 102));
  618. g.fill3DRect(187, 266, 329, 13, true);
  619. g.setColor(Color.WHITE);
  620. g.setFont(new java.awt.Font("Tahoma", 1, 10));
  621. g.drawString(" Level: " + currentHPLVL + " " + " Xp Gained: " + currentHP + " " + "Xp/Hour: " + (int) HPXPperHour + " " + HPpr + "%.", 190, (276));
  622. }
  623. if (!paintATT) {
  624. currentATT = skills.getCurrentExp(Skills.ATTACK) - startATT;
  625. if (currentATT > 0) {
  626. paintATT = true;
  627. }
  628. } else {
  629. currentATT = skills.getCurrentExp(Skills.ATTACK) - startATT;
  630. float ATTXPperSec = 0;
  631. if ((minutes > 0 || hours > 0 || seconds > 0) && currentATT > 0) {
  632. ATTXPperSec = ((float) currentATT) / (float) (seconds + (minutes * 60) + (hours * 60 * 60));
  633.  
  634. }
  635. float ATTXPperMin = ATTXPperSec * 60;
  636. float ATTXPperHour = ATTXPperMin * 60;
  637. currentATTLVL = skills.getRealLevel(Skills.ATTACK);
  638. ATTpr = skills.getPercentToNextLevel(Skills.ATTACK);
  639. g.setColor(new Color(255, 51, 0));
  640. g.fill3DRect(187, 278, 329, 13, true);
  641. g.setColor(Color.WHITE);
  642. g.setFont(new java.awt.Font("Tahoma", 1, 10));
  643. g.drawString(" Level: " + currentATTLVL + " " + " Xp Gained: " + currentATT + " " + "Xp/Hour: " + (int) ATTXPperHour + " " + ATTpr + "%.", 190, (288));
  644.  
  645. }
  646.  
  647. if (!paintRNG) {
  648. currentRNG = skills.getCurrentExp(Skills.RANGE) - startRNG;
  649. if (currentRNG > 0) {
  650. paintRNG = true;
  651. }
  652. } else {
  653. currentRNG = skills.getCurrentExp(Skills.RANGE) - startRNG;
  654. float RNGXPperSec = 0;
  655. if ((minutes > 0 || hours > 0 || seconds > 0) && currentRNG > 0) {
  656. RNGXPperSec = ((float) currentRNG) / (float) (seconds + (minutes * 60) + (hours * 60 * 60));
  657. }
  658. float RNGXPperMin = RNGXPperSec * 60;
  659. float RNGXPperHour = RNGXPperMin * 60;
  660. currentRNGLVL = skills.getRealLevel(Skills.RANGE);
  661. RNGpr = skills.getPercentToNextLevel(Skills.RANGE);
  662. g.setColor(new Color(51, 153, 0));
  663. g.fill3DRect(187, 314, 329, 13, true);
  664. g.setColor(Color.WHITE);
  665. g.setFont(new java.awt.Font("Tahoma", 1, 10));
  666. g.drawString(" Level: " + currentRNGLVL + " " + "Xp Gained: " + currentRNG + " " + "Xp/Hour: " + (int) RNGXPperHour + " " + RNGpr + "%.", 190, (324));
  667. }
  668.  
  669. if (!paintMAG) {
  670. currentMAG = skills.getCurrentExp(Skills.MAGIC) - startMAG;
  671. if (currentMAG > 0) {
  672. paintMAG = true;
  673. }
  674. } else {
  675. currentMAG = skills.getCurrentExp(Skills.MAGIC) - startMAG;
  676. float MAGXPperSec = 0;
  677. if ((minutes > 0 || hours > 0 || seconds > 0) && currentMAG > 0) {
  678. MAGXPperSec = ((float) currentMAG) / (float) (seconds + (minutes * 60) + (hours * 60 * 60));
  679.  
  680. }
  681. float MAGXPperMin = MAGXPperSec * 60;
  682. float MAGXPperHour = MAGXPperMin * 60;
  683. currentMAGLVL = skills.getRealLevel(Skills.MAGIC);
  684. MAGpr = skills.getPercentToNextLevel(Skills.MAGIC);
  685. g.setColor(new Color(51, 0, 255));
  686. g.fill3DRect(187, 327, 329, 12, true);
  687. g.setColor(Color.WHITE);
  688. g.setFont(new java.awt.Font("Tahoma", 1, 10));
  689. g.drawString(" Level: " + currentMAGLVL + " " + " Xp Gained: " + currentMAG + " " + "Xp/Hour: " + (int) MAGXPperHour + " " + MAGpr + "%.", 190, (337));
  690.  
  691. }
  692. g.setColor(new Color(0, 0, 0, 100));
  693. g.fill3DRect(3, 266, 184, 73, true);
  694. g.setColor(new Color(227, 100, 45));
  695. g.drawString("Ownageful GDK", 15, 277);
  696. g.setColor(Color.white);
  697.  
  698. g.drawString("Time running: " + hours + ":" + minutes + ":" + seconds + ".", 15, 289);
  699. g.drawString("Status: " + status, 15, 301);
  700. g.drawString("Total Loot: " + (int) totalLoot, 15, 313);
  701. g.drawString("Loot Per Hour: " + (int) (profitPerSecond * 3600), 15, 325);
  702. g.drawString("Bank Runs: " + bankRuns + " times.", 15, 337);
  703.  
  704.  
  705. g.setColor(new Color(0, 0, 0, 100));
  706. g.fill3DRect(3, 20, 50, 65, true);
  707. g.setColor(new Color(227, 100, 45));
  708. g.drawString("Spawn Times:", 15, 31);
  709. g.setColor(Color.white);
  710.  
  711. g.drawString("Nw: " + ((int) ((tnw.getRemaining()) / 1000)), 15, 43);
  712. g.drawString("Ne: " + ((int) ((tne.getRemaining()) / 1000)), 15, 55);
  713. g.drawString("Sw: " + ((int) ((tsw.getRemaining()) / 1000)), 15, 67);
  714. g.drawString("Se: " + ((int) ((tse.getRemaining()) / 1000)), 15, 79);
  715.  
  716.  
  717. g.setFont(new java.awt.Font("Tahoma", 1, 10));
  718. if (paintHP) {
  719. g.setColor(new Color(255, 0, 102));
  720. g.drawString("Hp", 164, (276));
  721. }
  722. if (paintATT) {
  723. g.setColor(new Color(255, 51, 0));
  724. g.drawString("Att", 164, (288));
  725. }
  726. if (paintSTR) {
  727. g.setColor(new Color(255, 102, 0));
  728. g.drawString("Str", 164, (300));
  729. }
  730. if (paintDEF) {
  731. g.setColor(new Color(102, 102, 255));
  732. g.drawString("Def", 164, (312));
  733. }
  734. if (paintRNG) {
  735. g.setColor(new Color(51, 153, 0));
  736. g.drawString("Rng", 164, (324));
  737. }
  738. if (paintMAG) {
  739. g.setColor(new Color(51, 0, 255));
  740. g.drawString("Mgc", 164, (336));
  741. }
  742. }
  743.  
  744. }
  745.  
  746. public void serverMessageRecieved(ServerMessageEvent sme) {
  747. String str = sme.getMessage().toString();
  748. if (str.contains("super strength")) {
  749. pstr = true;
  750. }
  751. if (str.contains("super attack")) {
  752. patt = true;
  753. }
  754. if (str.contains("super defence")) {
  755. pdef = true;
  756. }
  757. if (str.contains("antifire")) {
  758. panti = true;
  759. }
  760. if (str.contains("fiery breath") && panti) {
  761. nanti = true;
  762. }
  763. if (str.contains("unknown portal")) {
  764. ntele = true;
  765. }
  766. }
  767.  
  768. @Override
  769. public void onFinish() {
  770. // Takes a screen shot when u stop the script.
  771. env.saveScreenshot(true);
  772. }
  773.  
  774. private int fight() {
  775. updateTimers();
  776. if (nanti) {
  777. if (inventory.containsOneOf(antiPots[0], antiPots[1], antiPots[2], antiPots[3])) {
  778. if (inventory.getItem(antiPots).doAction("Drink")) {
  779. sleep(random(800, 900));
  780. nanti = false;
  781. }
  782. }
  783. }
  784. if (inventory.isFull() && inventory.getCount(food) == 0) {
  785. try {
  786. inventory.getItem(vTabs).doAction("Break");
  787. } catch (NullPointerException e) {
  788. log("Out of varrock teleport.");
  789. stopScript();
  790. }
  791. sleep(random(7000, 8500));
  792. walking.walkTileMM(new RSTile(3208, 3435));
  793. while (getMyPlayer().isMoving()) {
  794. sleep(1000, 2000);
  795. }
  796. return 101;
  797. }
  798. if (game.isLoggedIn()) {
  799. if (getMyPlayer().getHPPercent() < hp) {
  800. if (inventory.contains(food)) {
  801. inventory.getItem(food).doAction("Eat");
  802. sleep(random(600, 800));
  803. return 100;
  804. } else {
  805. inventory.getItem(vTabs).doAction("Break");
  806. sleep(random(7000, 8500));
  807. walking.walkTileMM(new RSTile(3208, 3435));
  808. while (getMyPlayer().isMoving()) {
  809. sleep(1000, 2000);
  810. }
  811. return 101;
  812. }
  813. }
  814. }
  815. if (lCharms) {
  816. charmz = groundItems.getNearest(charms);
  817. if (charmz != null) {
  818. if (calc.tileOnScreen(charmz.getLocation())) {
  819. if (inventory.isFull() && inventory.contains(food) && !inventory.contains(charmz.getItem().getID())) {
  820. inventory.getItem(food).doAction("Eat");
  821. sleep(random(100, 300));
  822. }
  823. charmz.doAction("charm");
  824. while (getMyPlayer().isMoving()) {
  825. sleep(200, 400);
  826. }
  827. return 100;
  828. } else {
  829. walking.walkTileMM(charmz.getLocation());
  830. while (getMyPlayer().isMoving()) {
  831. sleep(200, 400);
  832. }
  833. return 100;
  834. }
  835. }
  836. }
  837. lootzd = groundItems.getNearest(loots);
  838. if (lootzd != null) {
  839. if (calc.tileOnScreen(lootzd.getLocation())) {
  840. if (inventory.isFull() && inventory.contains(food)) {
  841. inventory.getItem(food).doAction("Eat");
  842. sleep(random(600, 800));
  843. }
  844. for (int j = 0; j < loots.length; j++) {
  845. if (lootzd.getItem().getID() == loots[j]) {
  846. lootzd.doAction("Take " + names[j]);
  847.  
  848. while (getMyPlayer().isMoving()) {
  849. sleep(200, 400);
  850. }
  851. return 100;
  852. }
  853. }
  854. } else {
  855. walking.walkTileMM(lootzd.getLocation());
  856. while (getMyPlayer().isMoving()) {
  857. sleep(200, 400);
  858. }
  859. return 100;
  860. }
  861. }
  862.  
  863. RSCharacter inter = getMyPlayer().getInteracting();
  864. if (inter != null) {
  865. if (inter.getName().contains("Green")) {
  866. if (inter.getAnimation() == 92 || inter.getHPPercent() == 0) {
  867. if (getArea(inter) == se) {
  868. tse = new Timer(rTime);
  869. tse.reset();
  870. } else if (getArea(inter) == sw) {
  871. tsw = new Timer(rTime);
  872. tsw.reset();
  873. } else if (getArea(inter) == ne) {
  874. tne = new Timer(rTime);
  875. tne.reset();
  876. } else if (getArea(inter) == nw) {
  877. tnw = new Timer(rTime);
  878. tnw.reset();
  879. }
  880. sleep(random(4200, 4300));
  881. return 100;
  882. } else {
  883. sleep(random(200, 300));
  884. }
  885. } else {
  886. goTArea(getLTA());
  887. while (getMyPlayer().isMoving()) {
  888. RSNPC drag = npcs.getNearest(drags);
  889. if (drag != null) {
  890. if (drag.isOnScreen()) {
  891. if (npcIsInArea(getLTA(), drag)) {
  892. drag.doAction("Attack");
  893. sleep(random(800, 1200));
  894. }
  895. }
  896. }
  897. }
  898.  
  899. }
  900. } else {
  901. try {
  902. if (!isInArea(getLTA())) {
  903. if (getMyPlayer().getInteracting() != null) {
  904. if (getMyPlayer().getInteracting().getName().contains("Green")) {
  905. sleep(200, 300);
  906. } else {
  907. goTArea(getLTA());
  908. while (getMyPlayer().isMoving()) {
  909. RSNPC drag = npcs.getNearest(drags);
  910. if (drag != null) {
  911. if (drag.isOnScreen()) {
  912. if (npcIsInArea(getLTA(), drag)) {
  913. drag.doAction("Attack");
  914. }
  915. sleep(random(800, 1200));
  916. }
  917. }
  918. }
  919. }
  920. } else {
  921. goTArea(getLTA());
  922. while (getMyPlayer().isMoving()) {
  923. RSNPC drag = npcs.getNearest(drags);
  924. if (drag != null) {
  925. if (drag.isOnScreen()) {
  926. if (npcIsInArea(getLTA(), drag)) {
  927. drag.doAction("Attack");
  928. sleep(random(800, 1200));
  929. }
  930. }
  931. }
  932. }
  933. }
  934. }
  935. } catch (NullPointerException e) {
  936. //do nothing
  937. }
  938. RSNPC drag = npcs.getNearest(drags);
  939. if (drag != null) {
  940. if (getArea(drag) == getArea(getMyPlayer())) {
  941. drag.doAction("Attack");
  942. sleep(random(800, 1200));
  943. }
  944. }
  945. }
  946. return 100;
  947. }
  948.  
  949. private int antiban() {
  950. int i = random(0, 30);
  951. int ii = random(0, 25);
  952. if ((ii == 3) || (ii == 12)) {
  953. char dir = 37;
  954. if (random(0, 3) == 2) {
  955. dir = 39;
  956. }
  957. keyboard.pressKey(dir);
  958. sleep(random(500, 2000));
  959. keyboard.releaseKey(dir);
  960. return random(0, 500);
  961. } else if ((i == 7) || (i == 4)) {
  962. return random(0, 500);
  963. } else if ((i == 1) || (i == 8) || (i == 15) || (i == 20)) {
  964. Thread camera = new Thread() {
  965.  
  966. @Override
  967. public void run() {
  968. char dir = 37;
  969. if (random(0, 3) == 2) {
  970. dir = 39;
  971. }
  972. keyboard.pressKey(dir);
  973. try {
  974. Thread.sleep(random(500, 2000));
  975. } catch (InterruptedException e) {
  976. e.printStackTrace();
  977. }
  978. keyboard.releaseKey(dir);
  979. }
  980. };
  981. Thread mouseThread = new Thread() {
  982.  
  983. @Override
  984. public void run() {
  985. mouse.move(random(0, 500), random(0, 500));
  986. }
  987. };
  988. if ((i == 7) || (i == 20)) {
  989. camera.start();
  990. }
  991. if (i == 1) {
  992. mouseThread.start();
  993. }
  994. while (camera.isAlive() || mouseThread.isAlive()) {
  995. sleep(random(100, 300));
  996. return random(300, 700);
  997. }
  998. }
  999. return random(1000, 1500);
  1000.  
  1001. }
  1002.  
  1003. private void goTArea(int[] a) {
  1004. RSCharacter nc = getMyPlayer().getInteracting();
  1005. if (nc != null) {
  1006. if (!nc.getName().contains("Green")) {
  1007. if (a == ne) {
  1008. if (!isInArea(ne)) {
  1009. walking.walkTileMM(walking.getPath(new RSTile(3316, 5456)).getNext());
  1010. }
  1011. } else if (a == se) {
  1012. if (!isInArea(se)) {
  1013. walking.walkTileMM(walking.getPath(new RSTile(3315, 5449)).getNext());
  1014. }
  1015. } else if (a == sw) {
  1016. if (!isInArea(sw)) {
  1017. walking.walkTileMM(walking.getPath(new RSTile(3305, 5450)).getNext());
  1018. }
  1019. } else if (a == nw) {
  1020. if (!isInArea(nw)) {
  1021. walking.walkTileMM(walking.getPath(new RSTile(3306, 5461)).getNext());
  1022. }
  1023. }
  1024. }
  1025. } else {
  1026. if (a == ne) {
  1027. if (!isInArea(ne)) {
  1028. walking.walkTileMM(walking.getPath(new RSTile(3316, 5456)).getNext());
  1029. }
  1030. } else if (a == se) {
  1031. if (!isInArea(se)) {
  1032. walking.walkTileMM(walking.getPath(new RSTile(3315, 5449)).getNext());
  1033. }
  1034. } else if (a == sw) {
  1035. if (!isInArea(sw)) {
  1036. walking.walkTileMM(walking.getPath(new RSTile(3305, 5450)).getNext());
  1037. }
  1038. } else if (a == nw) {
  1039. if (!isInArea(nw)) {
  1040. walking.walkTileMM(walking.getPath(new RSTile(3306, 5461)).getNext());
  1041. }
  1042. }
  1043. }
  1044. }
  1045.  
  1046. public int[] getLTA() {
  1047. Timer[] timers = {tse, tsw, tne, tnw};
  1048. int n = timers.length;
  1049. Timer t;
  1050. for (int i = 0; i < n; i++) {
  1051. for (int j = 1; j < (n - i); j++) {
  1052. if (timers[j - 1].getRemaining() > timers[j].getRemaining()) {
  1053. t = timers[j - 1];
  1054. timers[j - 1] = timers[j];
  1055. timers[j] = t;
  1056. }
  1057. }
  1058. }
  1059. for (int i = 0; i < timers.length; i++) {
  1060. if (timers[i].getRemaining() != 0) {
  1061. if (timers[i] == tse) {
  1062. return se;
  1063. } else if (timers[i] == tsw) {
  1064. return sw;
  1065. } else if (timers[i] == tne) {
  1066. return ne;
  1067. } else if (timers[i] == tnw) {
  1068. return nw;
  1069. }
  1070. }
  1071. }
  1072.  
  1073. return null;
  1074. }
  1075.  
  1076. public int[] getArea(RSCharacter drag) {
  1077. if (drag != null) {
  1078. if (npcIsInArea(ne, drag)) {
  1079. return ne;
  1080. } else if (npcIsInArea(se, drag)) {
  1081. return se;
  1082. } else if (npcIsInArea(sw, drag)) {
  1083. return sw;
  1084. } else if (npcIsInArea(nw, drag)) {
  1085. return nw;
  1086. }
  1087. }
  1088. return null;
  1089. }
  1090.  
  1091. public RSNPC[] getDA() {
  1092. final ArrayList<RSNPC> RSNPCList = new ArrayList<RSNPC>();
  1093.  
  1094. RSNPC[] monster = npcs.getAll();
  1095. for (int x = 0; x < monster.length; x++) {
  1096. if (monster[x].getName().contains("Green")) {
  1097. RSNPCList.add(monster[x]);
  1098. }
  1099. }
  1100. return RSNPCList.toArray(new RSNPC[RSNPCList.size()]);
  1101. }
  1102.  
  1103. public boolean openTab(int tab) {
  1104. if (!bank.isOpen()) {
  1105. return false;
  1106. } else {
  1107. try {
  1108. return bank.getInterface().getComponent(68 - (tab * 2)).doClick();
  1109. } catch (NullPointerException e) {
  1110. return false;
  1111. }
  1112. }
  1113. }
  1114.  
  1115. private void updateTimers() {
  1116. gd = getDA();
  1117. for (int j = 0; j < gd.length; j++) {
  1118. RSNPC inter = gd[j];
  1119. if (inter != null) {
  1120. if (getArea(inter) == se) {
  1121. if (inter.getAnimation() == 12250 || inter.getHPPercent() == 0) {
  1122. tse = new Timer(rTime);
  1123. tse.reset();
  1124. }
  1125. } else if (getArea(inter) == sw) {
  1126. if (inter.getAnimation() == 12250 || inter.getHPPercent() == 0) {
  1127. tsw = new Timer(rTime);
  1128. tsw.reset();
  1129. }
  1130. } else if (getArea(inter) == ne) {
  1131. if (inter.getAnimation() == 12250 || inter.getHPPercent() == 0) {
  1132. tne = new Timer(rTime);
  1133. tne.reset();
  1134. }
  1135. } else if (getArea(inter) == nw) {
  1136. if (inter.getAnimation() == 12250 || inter.getHPPercent() == 0) {
  1137. tnw = new Timer(rTime);
  1138. tnw.reset();
  1139. }
  1140. }
  1141. }
  1142. }
  1143. }
  1144.  
  1145. private void doPort() {
  1146. RSObject port = objects.getTopAt(portal);
  1147. if (port != null) {
  1148. if (calc.tileOnScreen(port.getLocation()) && calc.distanceTo(port.getLocation()) <= 3) {
  1149. while (getMyPlayer().isMoving()) {
  1150. sleep(1000, 2000);
  1151. }
  1152. port.doAction("Enter");
  1153. while (getMyPlayer().isMoving()) {
  1154. sleep(1000, 2000);
  1155. }
  1156. sleep(random(2500, 3000));
  1157. walking.walkTileMM(new RSTile(3307, 5460));
  1158. while (getMyPlayer().isMoving()) {
  1159. sleep(1000, 2000);
  1160. }
  1161. } else {
  1162. walkPath(toPort);
  1163. }
  1164. } else {
  1165. walkPath(toPort);
  1166. }
  1167. }
  1168.  
  1169. public class GDK extends javax.swing.JFrame {
  1170.  
  1171. public GDK() {
  1172.  
  1173. initComponents();
  1174. }
  1175.  
  1176. private void initComponents() {
  1177. jPanel1 = new javax.swing.JPanel();
  1178. jLabel1 = new javax.swing.JLabel();
  1179. jCheckBox1 = new javax.swing.JCheckBox();
  1180. jCheckBox2 = new javax.swing.JCheckBox();
  1181. jCheckBox3 = new javax.swing.JCheckBox();
  1182. jButton1 = new javax.swing.JButton();
  1183. jCheckBox4 = new javax.swing.JCheckBox();
  1184. jTextField1 = new javax.swing.JTextField();
  1185. jTextField2 = new javax.swing.JTextField();
  1186. jSlider1 = new javax.swing.JSlider();
  1187. jLabel2 = new javax.swing.JLabel();
  1188.  
  1189. setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
  1190.  
  1191. jPanel1.setBackground(new java.awt.Color(0, 0, 0));
  1192.  
  1193. jLabel1.setFont(new java.awt.Font("Viner Hand ITC", 0, 36));
  1194. jLabel1.setForeground(new java.awt.Color(204, 0, 0));
  1195. jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
  1196. jLabel1.setText("Ownageful GDK");
  1197.  
  1198. jCheckBox1.setBackground(new java.awt.Color(0, 0, 0));
  1199. jCheckBox1.setForeground(new java.awt.Color(255, 0, 0));
  1200. jCheckBox1.setSelected(true);
  1201. jCheckBox1.setText("Eat Food");
  1202.  
  1203. jCheckBox2.setBackground(new java.awt.Color(0, 0, 0));
  1204. jCheckBox2.setForeground(new java.awt.Color(255, 0, 0));
  1205. jCheckBox2.setSelected(true);
  1206. jCheckBox2.setText("Drink Supers");
  1207.  
  1208. jCheckBox3.setBackground(new java.awt.Color(0, 0, 0));
  1209. jCheckBox3.setForeground(new java.awt.Color(255, 0, 0));
  1210. jCheckBox3.setSelected(true);
  1211. jCheckBox3.setText("Drink AntiFire");
  1212.  
  1213. jButton1.setBackground(new java.awt.Color(0, 0, 0));
  1214. jButton1.setText("Start");
  1215. jButton1.addActionListener(new java.awt.event.ActionListener() {
  1216.  
  1217. public void actionPerformed(java.awt.event.ActionEvent evt) {
  1218. jButton1ActionPerformed(evt);
  1219. }
  1220. });
  1221.  
  1222. jCheckBox4.setBackground(new java.awt.Color(0, 0, 0));
  1223. jCheckBox4.setForeground(new java.awt.Color(255, 51, 0));
  1224. jCheckBox4.setSelected(true);
  1225. jCheckBox4.setText("Loot Charms");
  1226. jCheckBox4.setSelected(false);
  1227.  
  1228. jTextField1.setText("Food ID");
  1229. jTextField1.addMouseListener(new java.awt.event.MouseAdapter() {
  1230.  
  1231. @Override
  1232. public void mouseClicked(java.awt.event.MouseEvent evt) {
  1233. jTextField1MouseClicked(evt);
  1234. }
  1235. });
  1236.  
  1237. jTextField2.setText("Amount");
  1238. jTextField2.addMouseListener(new java.awt.event.MouseAdapter() {
  1239.  
  1240. @Override
  1241. public void mouseClicked(java.awt.event.MouseEvent evt) {
  1242. jTextField2MouseClicked(evt);
  1243. }
  1244. });
  1245.  
  1246. jSlider1.setBackground(new java.awt.Color(0, 0, 0));
  1247. jSlider1.setForeground(new java.awt.Color(204, 0, 0));
  1248. jSlider1.setPaintLabels(true);
  1249.  
  1250. jLabel2.setForeground(new java.awt.Color(204, 0, 0));
  1251. jLabel2.setText("Eat food at (%)");
  1252.  
  1253. javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
  1254. jPanel1.setLayout(jPanel1Layout);
  1255. jPanel1Layout.setHorizontalGroup(
  1256. jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createSequentialGroup().addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 298, Short.MAX_VALUE).addContainerGap()).addGroup(jPanel1Layout.createSequentialGroup().addGap(10, 10, 10).addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jCheckBox3).addComponent(jCheckBox1).addComponent(jCheckBox2)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 39, Short.MAX_VALUE).addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createSequentialGroup().addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)).addGroup(jPanel1Layout.createSequentialGroup().addGap(10, 10, 10).addComponent(jCheckBox4))).addGap(51, 51, 51))).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jLabel2).addGroup(jPanel1Layout.createSequentialGroup().addComponent(jSlider1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jButton1))).addGap(27, 27, 27)))));
  1257. jPanel1Layout.setVerticalGroup(
  1258. jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createSequentialGroup().addComponent(jLabel1).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jCheckBox1).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jCheckBox3).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jCheckBox2).addComponent(jCheckBox4))).addGroup(jPanel1Layout.createSequentialGroup().addGap(82, 82, 82).addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jTextField1).addComponent(jTextField2)).addGap(40, 40, 40))).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jLabel2).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addComponent(jSlider1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(jButton1)).addContainerGap()));
  1259.  
  1260. javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  1261. getContentPane().setLayout(layout);
  1262. layout.setHorizontalGroup(
  1263. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
  1264. layout.setVerticalGroup(
  1265. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE));
  1266.  
  1267. pack();
  1268. }
  1269.  
  1270. private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
  1271. try {
  1272. if (jCheckBox1.isSelected()) {
  1273. food = Integer.parseInt(jTextField1.getText());
  1274. withdraw = Integer.parseInt(jTextField2.getText());
  1275. eat = true;
  1276. }
  1277. if (jCheckBox3.isSelected()) {
  1278. useAnti = true;
  1279. }
  1280. if (jCheckBox2.isSelected()) {
  1281. useSupers = true;
  1282. }
  1283. if (jCheckBox4.isSelected()) {
  1284. lCharms = true;
  1285. }
  1286. hp = jSlider1.getValue();
  1287. this.dispose();
  1288. startScript = true;
  1289. } catch (NumberFormatException numberFormatException) {
  1290. log("Invalid food id format.");
  1291. }
  1292. }
  1293.  
  1294. private void jTextField1MouseClicked(java.awt.event.MouseEvent evt) {
  1295. jTextField1.setText("");
  1296. }
  1297.  
  1298. private void jTextField2MouseClicked(java.awt.event.MouseEvent evt) {
  1299. jTextField2.setText("");
  1300. }
  1301.  
  1302. private void jTextField1MouseEntered(java.awt.event.MouseEvent evt) {
  1303. jTextField1.setText("");
  1304. }
  1305.  
  1306. private void jTextField2MouseEntered(java.awt.event.MouseEvent evt) {
  1307. jTextField2.setText("");
  1308. }
  1309. private javax.swing.JButton jButton1;
  1310. private javax.swing.JCheckBox jCheckBox1;
  1311. private javax.swing.JCheckBox jCheckBox2;
  1312. private javax.swing.JCheckBox jCheckBox3;
  1313. private javax.swing.JCheckBox jCheckBox4;
  1314. private javax.swing.JLabel jLabel1;
  1315. private javax.swing.JLabel jLabel2;
  1316. private javax.swing.JPanel jPanel1;
  1317. private javax.swing.JSlider jSlider1;
  1318. private javax.swing.JTextField jTextField1;
  1319. private javax.swing.JTextField jTextField2;
  1320. }
  1321. }
Add Comment
Please, Sign In to add comment