Advertisement
Guest User

Untitled

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