Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.78 KB | None | 0 0
  1. * -----Imports-----
  2.  
  3. import java.awt.*;
  4.  
  5. /*
  6. * -----ScriptManifest-----
  7. */
  8.  
  9. @ScriptManifest(
  10. authors = "Rickk12345",
  11. name = "AMCMiner",
  12. description = "Adamantite, Mithril, Coal and Iron Miner!",
  13. keywords = ("miner"),
  14. version = 1.2
  15. )
  16.  
  17. public class AMCMiner extends Script implements PaintListener, MessageListener, MouseListener {
  18.  
  19. /*
  20. * -----Basic Integers; Rocks Etc-----
  21. */
  22.  
  23. private final static int[] MINE_ID = {3040, 3273, 3041, 3280, 11942, 11943, 11944, 32438, 32439, 31086, 31088, 3233, 3032};
  24. private final static int[] BOOTH_ID = {2213, 35647, 782};
  25. private final static int[] PICK_ID = {1265, 1267, 1269, 1271, 1273, 1275};
  26. private final static int[] MITH_ID = {3041, 3280, 11942, 11943, 11944, 32438, 32439, 31086, 31088};
  27. private final static int[] COAL_ID = {3233, 3032};
  28. private final static int[] ADDY_ID = {3040, 3273, 11939, 11941};
  29. private final static int[] IRON_ID = {37305, 37307, 37308, 37309, 11956, 11955};
  30. private final static int MINING_ANIMATION = 624;
  31. private final static int COAL_INV_ID = 453;
  32. private final static int MITH_INV_ID = 447;
  33. private final static int ADDY_INV_ID = 449;
  34. private final static int IRON_INV_ID = 440;
  35.  
  36. /*
  37. * -----Walking Paths-----
  38. */
  39.  
  40. private boolean alk;
  41.  
  42. private RSTile TILE_TO_BANK;
  43. private RSTile TILE_TO_MINE;
  44.  
  45. private RSTile TILE_TO_BANK_LUM = new RSTile(3094, 3243);
  46. private RSTile TILE_TO_BANK_ALK = new RSTile(3270, 3167);
  47. private RSTile TILE_TO_BANK_EVAR = new RSTile(3184, 3436);
  48.  
  49. private RSTile TILE_TO_MINE_LUM = new RSTile(3146, 3146);
  50. private RSTile TILE_TO_MINE_ALK_IRON = new RSTile(3297, 3300);
  51. private RSTile TILE_TO_MINE_ALK_AMC1 = new RSTile(3300, 3308);
  52. private RSTile TILE_TO_MINE_ALK_AMC2 = new RSTile(3300, 3312);
  53. private RSTile TILE_TO_MINE_EVAR = new RSTile(3180, 3369);
  54.  
  55. private RSArea lumMine = new RSArea(new RSTile(3140, 3140), new RSTile(3155, 3155));
  56. private RSArea alkMine = new RSArea(new RSTile(3285, 3277), new RSTile(3311, 3322));
  57. private RSArea eVarMine = new RSArea(new RSTile(3170, 3362), new RSTile(3187, 3379));
  58.  
  59. private RSArea mine;
  60. private RSTile location;
  61.  
  62. /*
  63. * -----Paint And GUI Variables-----
  64. */
  65.  
  66. ScriptManifest scriptM = getClass().getAnnotation(ScriptManifest.class);
  67.  
  68. private long startTime;
  69.  
  70. private int expGained = 0;
  71. private int startExp = 0;
  72.  
  73. private int startLevel = 0;
  74. private int endLevel = 0;
  75.  
  76. private int startPer = 0;
  77. private int endPer = 0;
  78.  
  79. private int levelsGained = (endLevel - startLevel);
  80.  
  81. private int gemsFound = 0;
  82. private int mithMined = 0;
  83. private int coalMined = 0;
  84. private int addyMined = 0;
  85. private int ironMined = 0;
  86.  
  87. Rectangle close = new Rectangle(393, 308, 100, 27);
  88. Point p;
  89. private boolean showPaint = true;
  90.  
  91. private int coalPrice = 0;
  92. private int mithPrice = 0;
  93. private int addyPrice = 0;
  94. //private int orePrice = 0;
  95. //private int orePrice2 = 0;
  96.  
  97. private int[] chosenOre;
  98. private int[] chosenOre2;
  99. private int[] chosenOre3;
  100. private int chosenInvOre = 0;
  101. private int chosenInvOre2 = 0;
  102. private int chosenInvOre3 = 0;
  103.  
  104. private String status = "";
  105. private String status1 = "";
  106. private String status2 = "";
  107. private String status3 = "";
  108.  
  109. private boolean guiWait = true;
  110. AMCgui2 g = new AMCgui2();
  111.  
  112. private boolean powerMine;
  113. private boolean bankMode;
  114.  
  115. /*
  116. * -----INFO-----
  117. * Made by: Rickk12345
  118. * Programs used:
  119. * JFormDesigner
  120. * Eclipse
  121. * Enfilade's Easel
  122. *
  123. * And of course, credits to the Indigestion (mrIndigestion on YouTube) tutorials which learnt me scripting.
  124. */
  125.  
  126. /*
  127. * -----OnStart And OnFinish Methods-----
  128. */
  129.  
  130. public boolean onStart() {
  131.  
  132. g.setVisible(true);
  133. while(guiWait) sleep(500);
  134.  
  135. log("Initializing Script, Please Wait.");
  136.  
  137. location = getMyPlayer().getLocation();
  138.  
  139. startTime = System.currentTimeMillis();
  140. startExp = skills.getCurrentExp(skills.MINING);
  141. startLevel = skills.getCurrentLevel(skills.MINING);
  142. startPer = skills.getPercentToNextLevel(skills.MINING);
  143.  
  144. coalPrice = grandExchange.lookup(COAL_INV_ID).getGuidePrice();
  145. mithPrice = grandExchange.lookup(MITH_INV_ID).getGuidePrice();
  146. addyPrice = grandExchange.lookup(ADDY_INV_ID).getGuidePrice();
  147. //orePrice = grandEchange.lookup(chosenInvOre).getGuidePrice();
  148. //orePrice2 = grandEchange.lookup(chosenInvOre).getGuidePrice();
  149.  
  150. log("Script Initialized.");
  151.  
  152. return true;
  153. }
  154.  
  155. public void onFinish() {
  156. env.saveScreenshot(false);
  157.  
  158. status = "Stopping Script.";
  159. endLevel = skills.getCurrentLevel(skills.MINING);
  160. endPer = skills.getPercentToNextLevel(skills.MINING);
  161.  
  162. log("Profit Made: " + (mithMined*mithPrice + coalMined*coalPrice));
  163. log("Experience Gained: " + expGained);
  164. log("Levels Gained: " + levelsGained);
  165. log("Gems Found: " + gemsFound);
  166. log("Iron Mined: " + ironMined);
  167. log("Coal Mined: " + coalMined);
  168. log("Mithril Mined: " + mithMined);
  169. log("Adamantite Mined: " + addyMined);
  170. log("Thank you for using " + scriptM.name() + " v" + scriptM.version() + "!");
  171. }
  172.  
  173. /*
  174. * -----Loop-----
  175. * If inv = full and powermine is checked, drop ores. If powermine is not checked, and you're at bank, start banking process.
  176. * When not at the bank, walk to the bank.
  177. * When inv = not full, and you're not at the mine, walk to mine.
  178. * When you are at the mine, check if there is ore1 (most important ore, defined by user in GUI).
  179. * If there is ore1, mine it. If not, check if there is ore2, if there is, mine it, if not, check if there is
  180. * ore3 (the least important ore, defined by user in GUI). If there is, mine it, otherwise sleep and do antiban.
  181. */
  182.  
  183. @Override
  184. public int loop() {
  185. if(!atMine()) {
  186. if(!atBank()) {
  187. log(Color.RED,"Not At Bank Or Mine. Stopping Script.");
  188. stopScript();
  189. }
  190. }
  191. if(inventory.isFull()) {
  192. if(powerMine) {
  193. if(!bankMode) {
  194. dropOre();
  195. } else {
  196. log(Color.RED,"ERROR: Can't Bank AND PowerMine. Stopping Script.");
  197. stopScript();
  198. }
  199. } else {
  200. if(bankMode) {
  201. if(!powerMine) {
  202. if(atBank()) {
  203. doBank();
  204. } else {
  205. walk();
  206. }
  207. } else {
  208. log(Color.RED,"ERROR: Can't Bank AND PowerMine. Stopping Script.");
  209. stopScript();
  210. }
  211. }
  212. }
  213. } else {
  214. if(!atMine()) {
  215. walkR();
  216. } if(ore1()) {
  217. mineOre1();
  218. } if(!ore1()) {
  219. if(ore2()) {
  220. mineOre2();
  221. } else {
  222. } if(!ore2()) {
  223. if(ore3()) {
  224. mineOre3();
  225. } else {
  226. sleep(1,2);
  227. if(random (1, 15) == 4) {
  228. antiBan();
  229. }
  230. }
  231. }
  232. }
  233. }
  234. return random (200, 300);
  235. }
  236.  
  237. /*
  238. * -----Methods-----
  239. */
  240.  
  241. /*
  242. * -----Ore / Rock Methods-----
  243. */
  244.  
  245. private final boolean ore1() {
  246. RSObject rock = objects.getNearest(chosenOre);
  247. if(rock != null) {
  248. if(rock.isOnScreen()) {
  249. return true;
  250. }
  251. }
  252. if(alk) {
  253. walking.getWebPath(TILE_TO_MINE_ALK_AMC1);
  254. }
  255. return false;
  256. }
  257.  
  258. private final boolean ore2() {
  259. RSObject rock = objects.getNearest(chosenOre2);
  260. if(rock != null) {
  261. if(rock.isOnScreen()) {
  262. return true;
  263. }
  264. }
  265. if(alk) {
  266. walking.getWebPath(TILE_TO_MINE_ALK_AMC2);
  267. }
  268. return false;
  269. }
  270.  
  271. private final boolean ore3() {
  272. RSObject rock = objects.getNearest(chosenOre3);
  273. if(rock != null) {
  274. if(rock.isOnScreen()) {
  275. return true;
  276. }
  277. }
  278. if(alk) {
  279. walking.getWebPath(TILE_TO_MINE_ALK_AMC2);
  280. }
  281. return false;
  282. }
  283.  
  284. /*
  285. * -----Location Methods-----
  286. */
  287.  
  288. private final boolean atMine() {
  289. if(mine.contains(location)) {
  290. return true;
  291. }
  292. return false;
  293. }
  294.  
  295. private final boolean atBank() {
  296. RSObject bank = objects.getNearest(BOOTH_ID);
  297. if(bank != null){
  298. if(bank.isOnScreen()) {
  299. return true;
  300. }
  301. }
  302. return false;
  303. }
  304.  
  305. /*
  306. * -----What-To-Do-With-Ores Methods (Drop, Bank, Mine)-----
  307. */
  308.  
  309. private final boolean dropOre() {
  310. status = "Dropping Ores.";
  311. while (inventory.getCount() > 1) {
  312. inventory.dropAllExcept(PICK_ID);
  313. }
  314. return true;
  315. }
  316.  
  317. private final void mineOre1() {
  318. status = "Mining " + status1 + "." ;
  319. RSObject rock = objects.getNearest(chosenOre);
  320. if(getMyPlayer().getAnimation() != MINING_ANIMATION) {
  321. try {
  322. rock.doAction("Mine");
  323. if(random(1, 30) == 7) antiBan();
  324. } catch (NullPointerException e) {
  325. log(Color.RED,"ERROR: Error Occured While Mining " + chosenOre + ".");
  326. }
  327. }
  328. sleep(100, 200);
  329. }
  330.  
  331. private final void mineOre2() {
  332. status = "Mining " + status2 + "." ;
  333. RSObject rock = objects.getNearest(chosenOre2);
  334. if(getMyPlayer().getAnimation() != MINING_ANIMATION) {
  335. try {
  336. rock.doAction("Mine");
  337. if(random(1, 30) == 28) antiBan();
  338. } catch (NullPointerException e) {
  339. log(Color.RED,"ERROR: Error Occured While Mining " + chosenOre2 + ".");
  340. }
  341. }
  342. sleep(100, 200);
  343. }
  344.  
  345. private final void mineOre3() {
  346. status = "Mining " + status3 + "." ;
  347. RSObject rock = objects.getNearest(chosenOre3);
  348. if(getMyPlayer().getAnimation() != MINING_ANIMATION) {
  349. try {
  350. rock.doAction("Mine");
  351. if(random(1, 30) == 14) antiBan();
  352. } catch (NullPointerException e) {
  353. log(Color.RED,"ERROR: Error Occured While Mining " + chosenOre3 + ".");
  354. }
  355. }
  356. sleep(100, 200);
  357. }
  358.  
  359. private final void doBank() {
  360. status = "Banking.";
  361. if(bank.isOpen()) {
  362. bank.depositAllExcept(PICK_ID);
  363. sleep(800, 1200);
  364. } else {
  365. bank.open();
  366. sleep(1800, 2200);
  367. }
  368. }
  369.  
  370. /*
  371. * -----Walking Methods-----
  372. */
  373.  
  374. private final void walk() {
  375. status = "Walking To Bank.";
  376. walking.getWebPath(TILE_TO_BANK);
  377. if(random(0, 50) == 16) antiBan();
  378. }
  379.  
  380. private final void walkR() {
  381. status = "Walking To Mine.";
  382. walking.getWebPath(TILE_TO_MINE);
  383. if(random(0, 38) == 18) antiBan();
  384. }
  385.  
  386. /*
  387. * -----Paint Methods-----
  388. */
  389.  
  390. public void mouseClicked(MouseEvent e) {
  391. p = e.getPoint();
  392. if(close.contains(p) && showPaint) {
  393. showPaint = false;
  394. } else {
  395. if(close.contains(p) && !showPaint) {
  396. showPaint = true;
  397. }
  398. }
  399. }
  400.  
  401. public void mouseEntered(MouseEvent e) {
  402.  
  403. }
  404.  
  405. public void mouseExited(MouseEvent e) {
  406.  
  407. }
  408.  
  409. public void mouseReleased(MouseEvent e) {
  410.  
  411. }
  412.  
  413. public void mousePressed(MouseEvent e) {
  414.  
  415. }
  416.  
  417.  
  418. /*
  419. * -----PAINT-----
  420. */
  421.  
  422. //START: Code generated using Enfilade's Easel
  423. private final Color color1 = new Color(0, 0, 255, 140); // Blue Transparent BackGround
  424. private final Color color2 = new Color(0, 0, 0); // Black
  425. private final Color color3 = new Color(50, 240, 0); // MW2 Green
  426. private final Color color4 = new Color(255, 255, 255); // White
  427. private final Color color5 = new Color(0, 0, 255, 110); // Blue Transparent BackGround 2 (For Show / Hide Paint Button)
  428.  
  429. private final BasicStroke stroke1 = new BasicStroke(1);
  430.  
  431. private final Font font1 = new Font("BankGothic Md BT", 1, 32);
  432. private final Font font2 = new Font("BankGothic Md BT", 0, 14);
  433. private final Font font3 = new Font("BankGothic Md BT", 0, 13);
  434. //END: Code generated using Enfilade's Easel
  435.  
  436. public void onRepaint(Graphics g) {
  437.  
  438. expGained = skills.getCurrentExp(skills.MINING) - startExp;
  439.  
  440. /*
  441. * -----Time Declaration-----
  442. */
  443.  
  444. long millis = System.currentTimeMillis() - startTime;
  445. long hours = millis / (1000 * 60 * 60);
  446. millis -= hours * (1000 * 60 * 60);
  447. long minutes = millis / (1000 * 60);
  448. millis -= minutes * (1000 * 60);
  449. long seconds = millis / 1000;
  450.  
  451. float xpsec = 0;
  452. if((minutes > 0 || hours > 0 || seconds > 0) && expGained > 0) {
  453. xpsec = ((float) expGained)/(float)(seconds + (minutes*60) + (hours*60*60));
  454. }
  455. float xpmin = xpsec * 60;
  456. float xphour = xpmin * 60;
  457.  
  458. /*
  459. * -----Ores & Time-----
  460. */
  461.  
  462. float addyoresec = 0;
  463. if((minutes > 0 || hours > 0 || seconds > 0) && addyMined > 0) {
  464. addyoresec = ((float) addyMined)/(float)(seconds + (minutes*60) + (hours*60*60));
  465. }
  466.  
  467. float addyoremin = addyoresec * 60;
  468. float addyorehour = addyoremin * 60;
  469.  
  470. float mithoresec = 0;
  471. if((minutes > 0 || hours > 0 || seconds > 0) && mithMined > 0) {
  472. mithoresec = ((float) mithMined)/(float)(seconds + (minutes*60) + (hours*60*60));
  473. }
  474.  
  475. float mithoremin = mithoresec * 60;
  476. float mithorehour = mithoremin * 60;
  477.  
  478. float coaloresec = 0;
  479. if((minutes > 0 || hours > 0 || seconds > 0) && coalMined > 0) {
  480. coaloresec = ((float) coalMined)/(float)(seconds + (minutes*60) + (hours*60*60));
  481. }
  482. float coaloremin = coaloresec * 60;
  483. float coalorehour = coaloremin * 60;
  484.  
  485. float ironoresec = 0;
  486. if((minutes > 0 || hours > 0 || seconds > 0) && ironMined > 0) {
  487. ironoresec = ((float) ironMined)/(float)(seconds + (minutes*60) + (hours*60*60));
  488. }
  489. float ironoremin = ironoresec * 60;
  490. float ironorehour = ironoremin * 60;
  491.  
  492. /*
  493. * -----The Actual Paint-----
  494. */
  495.  
  496. Graphics2D g1 = (Graphics2D)g;
  497. // Hide/Show Paint
  498.  
  499. if(showPaint) {
  500. g1.setColor(color5);
  501. g1.fillRect(393, 308, 100, 27);
  502. g1.setFont(font2);
  503. g1.setColor(color4);
  504. g1.drawString("Hide Paint", 400, 325);
  505.  
  506. g1.setColor(color1);
  507. g1.fillRect(8, 345, 487, 112);
  508. g1.setColor(color2);
  509. g1.setStroke(stroke1);
  510. g1.drawRect(8, 345, 487, 112);
  511. g1.setFont(font1);
  512. g1.setColor(color3);
  513. g1.drawString("AMCMiner v" + scriptM.version() + "!", 10, 370);
  514. g1.setFont(font2);
  515. g1.setColor(color4);
  516. g1.drawString("Runtime: " + hours + ":" + minutes + ":" + seconds, 10, 385);
  517. if(powerMine) {
  518. g1.drawString("Profit Made: 0 (PowerMining)", 10, 400);
  519. } else {
  520. g1.drawString("Profit Made: " + (addyMined*addyPrice + mithMined*mithPrice + coalMined*coalPrice), 10, 400);
  521. }
  522. if(!status1.equals("Iron")) {
  523. g1.drawString("AMC/h: " + (int)addyorehour + " - " + (int)mithorehour + " - " + (int)coalorehour, 10, 415);
  524. g1.drawString("AMC Mined: " + addyMined + " - " + mithMined + " - " + coalMined, 10, 430);
  525. } else {
  526. g1.drawString("Iron/h: " + (int)ironorehour, 10, 415);
  527. g1.drawString("Iron Mined: " + ironMined, 10, 430);
  528. }
  529. g1.drawString("Exp/h: " + (int)xphour, 240, 385);
  530. g1.drawString("Exp Gained: " + expGained, 240, 400);
  531. g1.drawString("Exp To Level: " + skills.getExpToNextLevel(skills.MINING), 240, 415);
  532.  
  533. final int percentBar = (int) (skills.getPercentToNextLevel(skills.MINING)*4.2 / 2);
  534.  
  535. g1.setColor(Color.RED);
  536. g1.fillRoundRect(240, 430, 200, 10, 15, 15);
  537. g1.setColor(Color.GREEN);
  538. g1.fillRoundRect(240, 430, percentBar, 10, 15, 15);
  539. g1.setColor(Color.BLACK);
  540. g1.drawString("" + skills.getPercentToNextLevel(skills.MINING) + "% " + "To " + (1 + skills.getCurrentLevel(skills.MINING)), 305, 439);
  541. g1.drawRoundRect(240, 430, 200, 10, 15, 15);
  542. g1.drawRoundRect(240, 430, percentBar, 10, 15, 15);
  543.  
  544. // g1.drawString("Percent To Level: " + skills.getPercentToNextLevel(skills.MINING), 240, 430);
  545. g1.setFont(font3);
  546. g1.setColor(color3);
  547. g1.drawString("Rickk12345", 400, 453);
  548. g1.drawString("Status: " + status, 10, 453);
  549.  
  550. } else {
  551. if(!showPaint) {
  552. g1.setColor(color5);
  553. g1.fillRect(393, 308, 100, 27);
  554. g1.setFont(font2);
  555. g1.setColor(color4);
  556. g1.drawString("Show Paint", 400, 325);
  557. }
  558. }
  559. }
  560.  
  561. /*
  562. * -----Message Listener-----
  563. */
  564.  
  565. @Override
  566. public void messageReceived(MessageEvent e) {
  567. // Paint
  568. String txt = e.getMessage();
  569. if(txt.contains("You manage to mine some mithril.")) {
  570. mithMined++;
  571. }
  572. String txta = e.getMessage();
  573. if(txta.contains("You manage to mine some coal.")) {
  574. coalMined++;
  575. }
  576. String txtb = e.getMessage();
  577. if(txtb.contains("You manage to mine some adamantite.")) {
  578. addyMined++;
  579. }
  580. String txtc = e.getMessage();
  581. if(txtc.contains("You just found a")) {
  582. gemsFound++;
  583. }
  584. String txtd = e.getMessage();
  585. if(txtd.contains("You manage to mine some iron.")) {
  586. ironMined++;
  587. }
  588. }
  589.  
  590. /*
  591. * -----AntiBan-----
  592. */
  593.  
  594. private final void antiBan() {
  595. status = "Doing AntiBan.";
  596. int r = random(1, 7);
  597. switch(r) {
  598. case 2:
  599. mouse.moveSlightly();
  600. sleep(400, 600);
  601. break;
  602. case 3:
  603. mouse.moveRandomly(10,50);
  604. break;
  605. case 4:
  606. sleep(800, 8000);
  607. break;
  608. case 5:
  609. mouse.moveOffScreen();
  610. sleep(3000, 5000);
  611. break;
  612. case 6:
  613. camera.moveRandomly(random(500, 1500));
  614. break;
  615. }
  616. }
  617.  
  618. /*
  619. * -----GUI-----
  620. */
  621.  
  622. class AMCgui2 extends JFrame {
  623. public AMCgui2() {
  624. initComponents();
  625. }
  626.  
  627. private void button1ActionPerformed(ActionEvent e) {
  628. if(tree1.getLastSelectedPathComponent().toString().contains("Lumbridge West Swamp (Addy, Mith, Coal)B")) {
  629. bankMode = true;
  630. powerMine = false;
  631. TILE_TO_BANK = TILE_TO_BANK_LUM;
  632. TILE_TO_MINE = TILE_TO_MINE_LUM;
  633. status1 = "Addy";
  634. status2 = "Mith";
  635. status3 = "Coal";
  636. chosenOre = ADDY_ID;
  637. chosenOre2 = MITH_ID;
  638. chosenOre3 = COAL_ID;
  639. chosenInvOre = ADDY_INV_ID;
  640. chosenInvOre2 = MITH_INV_ID;
  641. chosenInvOre3 = COAL_INV_ID;
  642. mine = lumMine;
  643. alk = false;
  644.  
  645.  
  646. guiWait = false;
  647. g.dispose();
  648. } else {
  649. if(tree1.getLastSelectedPathComponent().toString().equals("Al Kharid (Addy, Mith, Coal)B")) {
  650. bankMode = true;
  651. powerMine = false;
  652. TILE_TO_BANK = TILE_TO_BANK_ALK;
  653. TILE_TO_MINE = TILE_TO_MINE_ALK_AMC1;
  654. status1 = "Addy";
  655. status2 = "Mith";
  656. status3 = "Coal";
  657. chosenOre = ADDY_ID;
  658. chosenOre2 = MITH_ID;
  659. chosenOre3 = COAL_ID;
  660. chosenInvOre = ADDY_INV_ID;
  661. chosenInvOre2 = MITH_INV_ID;
  662. chosenInvOre3 = COAL_INV_ID;
  663. mine = alkMine;
  664. alk = true;
  665.  
  666.  
  667. guiWait = false;
  668. g.dispose();
  669. } else {
  670. if(tree1.getLastSelectedPathComponent().toString().equals("Al Kharid (Iron)B")) {
  671. bankMode = true;
  672. powerMine = false;
  673. TILE_TO_BANK = TILE_TO_BANK_ALK;
  674. TILE_TO_MINE = TILE_TO_MINE_ALK_IRON;
  675. status1 = "Iron";
  676. status2 = "Iron";
  677. status3 = "Iron";
  678. chosenOre = IRON_ID;
  679. chosenOre2 = IRON_ID;
  680. chosenOre3 = IRON_ID;
  681. chosenInvOre = IRON_INV_ID;
  682. chosenInvOre2 = IRON_INV_ID;
  683. chosenInvOre3 = IRON_INV_ID;
  684. mine = alkMine;
  685. alk = true;
  686.  
  687. guiWait = false;
  688. g.dispose();
  689. } else {
  690. if(tree1.getLastSelectedPathComponent().toString().equals("East Varrock (Iron)B")) {
  691. bankMode = false;
  692. powerMine = true;
  693. TILE_TO_BANK = TILE_TO_BANK_EVAR;
  694. TILE_TO_MINE = TILE_TO_MINE_EVAR;
  695. status1 = "Iron";
  696. status2 = "Iron";
  697. status3 = "Iron";
  698. chosenOre = IRON_ID;
  699. chosenOre2 = IRON_ID;
  700. chosenOre3 = IRON_ID;
  701. chosenInvOre = IRON_INV_ID;
  702. chosenInvOre2 = IRON_INV_ID;
  703. chosenInvOre3 = IRON_INV_ID;
  704. mine = eVarMine;
  705. alk = false;
  706.  
  707.  
  708. guiWait = false;
  709. g.dispose();
  710. } else {
  711. if(tree1.getLastSelectedPathComponent().toString().equals("Lumbridge West Swamp (Addy, Mith, Coal)P")) {
  712. bankMode = false;
  713. powerMine = true;
  714. status1 = "Addy";
  715. status2 = "Mith";
  716. status3 = "Coal";
  717. chosenOre = ADDY_ID;
  718. chosenOre2 = MITH_ID;
  719. chosenOre3 = COAL_ID;
  720. chosenInvOre = ADDY_INV_ID;
  721. chosenInvOre2 = MITH_INV_ID;
  722. chosenInvOre3 = COAL_INV_ID;
  723. mine = lumMine;
  724. alk = false;
  725.  
  726.  
  727. guiWait = false;
  728. g.dispose();
  729. } else {
  730. if(tree1.getLastSelectedPathComponent().toString().equals("Al Kharid (Addy, Mith, Coal)P")) {
  731. bankMode = false;
  732. powerMine = true;
  733. status1 = "Addy";
  734. status2 = "Mith";
  735. status3 = "Coal";
  736. chosenOre = ADDY_ID;
  737. chosenOre2 = MITH_ID;
  738. chosenOre3 = COAL_ID;
  739. chosenInvOre = ADDY_INV_ID;
  740. chosenInvOre2 = MITH_INV_ID;
  741. chosenInvOre3 = COAL_INV_ID;
  742. mine = alkMine;
  743. alk = true;
  744.  
  745.  
  746. guiWait = false;
  747. g.dispose();
  748. } else {
  749. if(tree1.getLastSelectedPathComponent().toString().equals("Al Kharid (Iron)P")) {
  750. bankMode = false;
  751. powerMine = true;
  752. status1 = "Iron";
  753. status2 = "Iron";
  754. status3 = "Iron";
  755. chosenOre = IRON_ID;
  756. chosenOre2 = IRON_ID;
  757. chosenOre3 = IRON_ID;
  758. chosenInvOre = IRON_INV_ID;
  759. chosenInvOre2 = IRON_INV_ID;
  760. chosenInvOre3 = IRON_INV_ID;
  761. mine = alkMine;
  762. alk = true;
  763.  
  764.  
  765. guiWait = false;
  766. g.dispose();
  767. } else {
  768. if(tree1.getLastSelectedPathComponent().toString().equals("East Varrock (Iron)P")) {
  769. bankMode = false;
  770. powerMine = true;
  771. status1 = "Iron";
  772. status2 = "Iron";
  773. status3 = "Iron";
  774. chosenOre = IRON_ID;
  775. chosenOre2 = IRON_ID;
  776. chosenOre3 = IRON_ID;
  777. chosenInvOre = IRON_INV_ID;
  778. chosenInvOre2 = IRON_INV_ID;
  779. chosenInvOre3 = IRON_INV_ID;
  780. alk = false;
  781. mine = eVarMine;
  782.  
  783. guiWait = false;
  784. g.dispose();
  785. } else {
  786. if(tree1.getLastSelectedPathComponent().toString().equals("... (Coal)B")) {
  787. bankMode = true;
  788. powerMine = false;
  789. TILE_TO_BANK = TILE_TO_BANK_LUM;
  790. TILE_TO_MINE = TILE_TO_MINE_LUM;
  791. status1 = "Coal";
  792. status2 = "Coal";
  793. status3 = "Coal";
  794. chosenOre = COAL_ID;
  795. chosenOre2 = COAL_ID;
  796. chosenOre3 = COAL_ID;
  797. chosenInvOre = COAL_INV_ID;
  798. chosenInvOre2 = COAL_INV_ID;
  799. chosenInvOre3 = COAL_INV_ID;
  800. alk = false;
  801. mine = lumMine;
  802.  
  803. guiWait = false;
  804. g.dispose();
  805. } else {
  806. if(tree1.getLastSelectedPathComponent().toString().equals("Lumbridge West Swamp (Coal)P")) {
  807. bankMode = false;
  808. powerMine = true;
  809. status1 = "Coal";
  810. status2 = "Coal";
  811. status3 = "Coal";
  812. chosenOre = COAL_ID;
  813. chosenOre2 = COAL_ID;
  814. chosenOre3 = COAL_ID;
  815. chosenInvOre = COAL_INV_ID;
  816. chosenInvOre2 = COAL_INV_ID;
  817. chosenInvOre3 = COAL_INV_ID;
  818. alk = false;
  819. mine = lumMine;
  820.  
  821. guiWait = false;
  822. g.dispose();
  823. }
  824. }
  825. }
  826. }
  827. }
  828. }
  829. }
  830. }
  831. }
  832. }
  833. }
  834.  
  835.  
  836. private void initComponents() {
  837. scrollPane1 = new JScrollPane();
  838. tree1 = new JTree();
  839. label1 = new JLabel();
  840. button1 = new JButton();
  841.  
  842. //======== this ========
  843. setTitle("AMCMiner v" + scriptM.version() + "!");
  844. setFont(new Font("BankGothic Md BT", Font.BOLD, 18));
  845. Container contentPane = getContentPane();
  846.  
  847. //======== scrollPane1 ========
  848. {
  849.  
  850. //---- tree1 ----
  851. tree1.setModel(new DefaultTreeModel(
  852. new DefaultMutableTreeNode("Locations & Ores") {
  853. {
  854. DefaultMutableTreeNode node1 = new DefaultMutableTreeNode("Banking");
  855. node1.add(new DefaultMutableTreeNode("Lumbridge West Swamp (Addy, Mith, Coal)B"));
  856. node1.add(new DefaultMutableTreeNode("Al Kharid (Addy, Mith, Coal)B"));
  857. node1.add(new DefaultMutableTreeNode("Al Kharid (Iron)B"));
  858. node1.add(new DefaultMutableTreeNode("East Varrock (Iron)B"));
  859. node1.add(new DefaultMutableTreeNode("Lumbridge West Swamp (Coal)B"));
  860. add(node1);
  861. node1 = new DefaultMutableTreeNode("Powermining");
  862. node1.add(new DefaultMutableTreeNode("Lumbridge West Swamp (Addy, Mith, Coal)P"));
  863. node1.add(new DefaultMutableTreeNode("Al Kharid (Addy, Mith, Coal)P"));
  864. node1.add(new DefaultMutableTreeNode("Al Kharid (Iron)P"));
  865. node1.add(new DefaultMutableTreeNode("East Varrock (Iron)P"));
  866. node1.add(new DefaultMutableTreeNode("Lumbridge West Swamp (Coal)P"));
  867. add(node1);
  868. }
  869. }));
  870. tree1.setFont(new Font("BankGothic Md BT", Font.BOLD, 20));
  871. scrollPane1.setViewportView(tree1);
  872. }
  873.  
  874. //---- label1 ----
  875. label1.setText("AMCMiner v" + scriptM.version() + "!");
  876. label1.setFont(new Font("BankGothic Md BT", Font.BOLD, 60));
  877.  
  878.  
  879. //---- button1 ----
  880. button1.setText("Start!");
  881. button1.setFont(new Font("BankGothic Md BT", Font.BOLD, 20));
  882. button1.addActionListener(new ActionListener() {
  883. @Override
  884. public void actionPerformed(ActionEvent e) {
  885. button1ActionPerformed(e);
  886. }
  887. });
  888.  
  889. GroupLayout contentPaneLayout = new GroupLayout(contentPane);
  890. contentPane.setLayout(contentPaneLayout);
  891. contentPaneLayout.setHorizontalGroup(
  892. contentPaneLayout.createParallelGroup()
  893. .addGroup(contentPaneLayout.createSequentialGroup()
  894. .addGap(74, 74, 74)
  895. .addComponent(label1)
  896. .addContainerGap(76, Short.MAX_VALUE))
  897. .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
  898. .addContainerGap(293, Short.MAX_VALUE)
  899. .addComponent(button1, GroupLayout.PREFERRED_SIZE, 151, GroupLayout.PREFERRED_SIZE)
  900. .addGap(285, 285, 285))
  901. .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
  902. .addContainerGap()
  903. .addComponent(scrollPane1, GroupLayout.DEFAULT_SIZE, 709, Short.MAX_VALUE)
  904. .addContainerGap())
  905. );
  906. contentPaneLayout.setVerticalGroup(
  907. contentPaneLayout.createParallelGroup()
  908. .addGroup(contentPaneLayout.createSequentialGroup()
  909. .addContainerGap()
  910. .addComponent(label1)
  911. .addGap(18, 18, 18)
  912. .addComponent(scrollPane1, GroupLayout.PREFERRED_SIZE, 167, GroupLayout.PREFERRED_SIZE)
  913. .addGap(18, 18, 18)
  914. .addComponent(button1, GroupLayout.DEFAULT_SIZE, 65, Short.MAX_VALUE)
  915. .addContainerGap())
  916. );
  917. pack();
  918. setLocationRelativeTo(getOwner());
  919. }
  920. private JScrollPane scrollPane1;
  921. private JTree tree1;
  922. private JLabel label1;
  923. private JButton button1;
  924. }
  925. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement