Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- * -----Imports-----
- import java.awt.*;
- /*
- * -----ScriptManifest-----
- */
- @ScriptManifest(
- authors = "Rickk12345",
- name = "AMCMiner",
- description = "Adamantite, Mithril, Coal and Iron Miner!",
- keywords = ("miner"),
- version = 1.2
- )
- public class AMCMiner extends Script implements PaintListener, MessageListener, MouseListener {
- /*
- * -----Basic Integers; Rocks Etc-----
- */
- private final static int[] MINE_ID = {3040, 3273, 3041, 3280, 11942, 11943, 11944, 32438, 32439, 31086, 31088, 3233, 3032};
- private final static int[] BOOTH_ID = {2213, 35647, 782};
- private final static int[] PICK_ID = {1265, 1267, 1269, 1271, 1273, 1275};
- private final static int[] MITH_ID = {3041, 3280, 11942, 11943, 11944, 32438, 32439, 31086, 31088};
- private final static int[] COAL_ID = {3233, 3032};
- private final static int[] ADDY_ID = {3040, 3273, 11939, 11941};
- private final static int[] IRON_ID = {37305, 37307, 37308, 37309, 11956, 11955};
- private final static int MINING_ANIMATION = 624;
- private final static int COAL_INV_ID = 453;
- private final static int MITH_INV_ID = 447;
- private final static int ADDY_INV_ID = 449;
- private final static int IRON_INV_ID = 440;
- /*
- * -----Walking Paths-----
- */
- private boolean alk;
- private RSTile TILE_TO_BANK;
- private RSTile TILE_TO_MINE;
- private RSTile TILE_TO_BANK_LUM = new RSTile(3094, 3243);
- private RSTile TILE_TO_BANK_ALK = new RSTile(3270, 3167);
- private RSTile TILE_TO_BANK_EVAR = new RSTile(3184, 3436);
- private RSTile TILE_TO_MINE_LUM = new RSTile(3146, 3146);
- private RSTile TILE_TO_MINE_ALK_IRON = new RSTile(3297, 3300);
- private RSTile TILE_TO_MINE_ALK_AMC1 = new RSTile(3300, 3308);
- private RSTile TILE_TO_MINE_ALK_AMC2 = new RSTile(3300, 3312);
- private RSTile TILE_TO_MINE_EVAR = new RSTile(3180, 3369);
- private RSArea lumMine = new RSArea(new RSTile(3140, 3140), new RSTile(3155, 3155));
- private RSArea alkMine = new RSArea(new RSTile(3285, 3277), new RSTile(3311, 3322));
- private RSArea eVarMine = new RSArea(new RSTile(3170, 3362), new RSTile(3187, 3379));
- private RSArea mine;
- private RSTile location;
- /*
- * -----Paint And GUI Variables-----
- */
- ScriptManifest scriptM = getClass().getAnnotation(ScriptManifest.class);
- private long startTime;
- private int expGained = 0;
- private int startExp = 0;
- private int startLevel = 0;
- private int endLevel = 0;
- private int startPer = 0;
- private int endPer = 0;
- private int levelsGained = (endLevel - startLevel);
- private int gemsFound = 0;
- private int mithMined = 0;
- private int coalMined = 0;
- private int addyMined = 0;
- private int ironMined = 0;
- Rectangle close = new Rectangle(393, 308, 100, 27);
- Point p;
- private boolean showPaint = true;
- private int coalPrice = 0;
- private int mithPrice = 0;
- private int addyPrice = 0;
- //private int orePrice = 0;
- //private int orePrice2 = 0;
- private int[] chosenOre;
- private int[] chosenOre2;
- private int[] chosenOre3;
- private int chosenInvOre = 0;
- private int chosenInvOre2 = 0;
- private int chosenInvOre3 = 0;
- private String status = "";
- private String status1 = "";
- private String status2 = "";
- private String status3 = "";
- private boolean guiWait = true;
- AMCgui2 g = new AMCgui2();
- private boolean powerMine;
- private boolean bankMode;
- /*
- * -----INFO-----
- * Made by: Rickk12345
- * Programs used:
- * JFormDesigner
- * Eclipse
- * Enfilade's Easel
- *
- * And of course, credits to the Indigestion (mrIndigestion on YouTube) tutorials which learnt me scripting.
- */
- /*
- * -----OnStart And OnFinish Methods-----
- */
- public boolean onStart() {
- g.setVisible(true);
- while(guiWait) sleep(500);
- log("Initializing Script, Please Wait.");
- location = getMyPlayer().getLocation();
- startTime = System.currentTimeMillis();
- startExp = skills.getCurrentExp(skills.MINING);
- startLevel = skills.getCurrentLevel(skills.MINING);
- startPer = skills.getPercentToNextLevel(skills.MINING);
- coalPrice = grandExchange.lookup(COAL_INV_ID).getGuidePrice();
- mithPrice = grandExchange.lookup(MITH_INV_ID).getGuidePrice();
- addyPrice = grandExchange.lookup(ADDY_INV_ID).getGuidePrice();
- //orePrice = grandEchange.lookup(chosenInvOre).getGuidePrice();
- //orePrice2 = grandEchange.lookup(chosenInvOre).getGuidePrice();
- log("Script Initialized.");
- return true;
- }
- public void onFinish() {
- env.saveScreenshot(false);
- status = "Stopping Script.";
- endLevel = skills.getCurrentLevel(skills.MINING);
- endPer = skills.getPercentToNextLevel(skills.MINING);
- log("Profit Made: " + (mithMined*mithPrice + coalMined*coalPrice));
- log("Experience Gained: " + expGained);
- log("Levels Gained: " + levelsGained);
- log("Gems Found: " + gemsFound);
- log("Iron Mined: " + ironMined);
- log("Coal Mined: " + coalMined);
- log("Mithril Mined: " + mithMined);
- log("Adamantite Mined: " + addyMined);
- log("Thank you for using " + scriptM.name() + " v" + scriptM.version() + "!");
- }
- /*
- * -----Loop-----
- * If inv = full and powermine is checked, drop ores. If powermine is not checked, and you're at bank, start banking process.
- * When not at the bank, walk to the bank.
- * When inv = not full, and you're not at the mine, walk to mine.
- * When you are at the mine, check if there is ore1 (most important ore, defined by user in GUI).
- * If there is ore1, mine it. If not, check if there is ore2, if there is, mine it, if not, check if there is
- * ore3 (the least important ore, defined by user in GUI). If there is, mine it, otherwise sleep and do antiban.
- */
- @Override
- public int loop() {
- if(!atMine()) {
- if(!atBank()) {
- log(Color.RED,"Not At Bank Or Mine. Stopping Script.");
- stopScript();
- }
- }
- if(inventory.isFull()) {
- if(powerMine) {
- if(!bankMode) {
- dropOre();
- } else {
- log(Color.RED,"ERROR: Can't Bank AND PowerMine. Stopping Script.");
- stopScript();
- }
- } else {
- if(bankMode) {
- if(!powerMine) {
- if(atBank()) {
- doBank();
- } else {
- walk();
- }
- } else {
- log(Color.RED,"ERROR: Can't Bank AND PowerMine. Stopping Script.");
- stopScript();
- }
- }
- }
- } else {
- if(!atMine()) {
- walkR();
- } if(ore1()) {
- mineOre1();
- } if(!ore1()) {
- if(ore2()) {
- mineOre2();
- } else {
- } if(!ore2()) {
- if(ore3()) {
- mineOre3();
- } else {
- sleep(1,2);
- if(random (1, 15) == 4) {
- antiBan();
- }
- }
- }
- }
- }
- return random (200, 300);
- }
- /*
- * -----Methods-----
- */
- /*
- * -----Ore / Rock Methods-----
- */
- private final boolean ore1() {
- RSObject rock = objects.getNearest(chosenOre);
- if(rock != null) {
- if(rock.isOnScreen()) {
- return true;
- }
- }
- if(alk) {
- walking.getWebPath(TILE_TO_MINE_ALK_AMC1);
- }
- return false;
- }
- private final boolean ore2() {
- RSObject rock = objects.getNearest(chosenOre2);
- if(rock != null) {
- if(rock.isOnScreen()) {
- return true;
- }
- }
- if(alk) {
- walking.getWebPath(TILE_TO_MINE_ALK_AMC2);
- }
- return false;
- }
- private final boolean ore3() {
- RSObject rock = objects.getNearest(chosenOre3);
- if(rock != null) {
- if(rock.isOnScreen()) {
- return true;
- }
- }
- if(alk) {
- walking.getWebPath(TILE_TO_MINE_ALK_AMC2);
- }
- return false;
- }
- /*
- * -----Location Methods-----
- */
- private final boolean atMine() {
- if(mine.contains(location)) {
- return true;
- }
- return false;
- }
- private final boolean atBank() {
- RSObject bank = objects.getNearest(BOOTH_ID);
- if(bank != null){
- if(bank.isOnScreen()) {
- return true;
- }
- }
- return false;
- }
- /*
- * -----What-To-Do-With-Ores Methods (Drop, Bank, Mine)-----
- */
- private final boolean dropOre() {
- status = "Dropping Ores.";
- while (inventory.getCount() > 1) {
- inventory.dropAllExcept(PICK_ID);
- }
- return true;
- }
- private final void mineOre1() {
- status = "Mining " + status1 + "." ;
- RSObject rock = objects.getNearest(chosenOre);
- if(getMyPlayer().getAnimation() != MINING_ANIMATION) {
- try {
- rock.doAction("Mine");
- if(random(1, 30) == 7) antiBan();
- } catch (NullPointerException e) {
- log(Color.RED,"ERROR: Error Occured While Mining " + chosenOre + ".");
- }
- }
- sleep(100, 200);
- }
- private final void mineOre2() {
- status = "Mining " + status2 + "." ;
- RSObject rock = objects.getNearest(chosenOre2);
- if(getMyPlayer().getAnimation() != MINING_ANIMATION) {
- try {
- rock.doAction("Mine");
- if(random(1, 30) == 28) antiBan();
- } catch (NullPointerException e) {
- log(Color.RED,"ERROR: Error Occured While Mining " + chosenOre2 + ".");
- }
- }
- sleep(100, 200);
- }
- private final void mineOre3() {
- status = "Mining " + status3 + "." ;
- RSObject rock = objects.getNearest(chosenOre3);
- if(getMyPlayer().getAnimation() != MINING_ANIMATION) {
- try {
- rock.doAction("Mine");
- if(random(1, 30) == 14) antiBan();
- } catch (NullPointerException e) {
- log(Color.RED,"ERROR: Error Occured While Mining " + chosenOre3 + ".");
- }
- }
- sleep(100, 200);
- }
- private final void doBank() {
- status = "Banking.";
- if(bank.isOpen()) {
- bank.depositAllExcept(PICK_ID);
- sleep(800, 1200);
- } else {
- bank.open();
- sleep(1800, 2200);
- }
- }
- /*
- * -----Walking Methods-----
- */
- private final void walk() {
- status = "Walking To Bank.";
- walking.getWebPath(TILE_TO_BANK);
- if(random(0, 50) == 16) antiBan();
- }
- private final void walkR() {
- status = "Walking To Mine.";
- walking.getWebPath(TILE_TO_MINE);
- if(random(0, 38) == 18) antiBan();
- }
- /*
- * -----Paint Methods-----
- */
- public void mouseClicked(MouseEvent e) {
- p = e.getPoint();
- if(close.contains(p) && showPaint) {
- showPaint = false;
- } else {
- if(close.contains(p) && !showPaint) {
- showPaint = true;
- }
- }
- }
- public void mouseEntered(MouseEvent e) {
- }
- public void mouseExited(MouseEvent e) {
- }
- public void mouseReleased(MouseEvent e) {
- }
- public void mousePressed(MouseEvent e) {
- }
- /*
- * -----PAINT-----
- */
- //START: Code generated using Enfilade's Easel
- private final Color color1 = new Color(0, 0, 255, 140); // Blue Transparent BackGround
- private final Color color2 = new Color(0, 0, 0); // Black
- private final Color color3 = new Color(50, 240, 0); // MW2 Green
- private final Color color4 = new Color(255, 255, 255); // White
- private final Color color5 = new Color(0, 0, 255, 110); // Blue Transparent BackGround 2 (For Show / Hide Paint Button)
- private final BasicStroke stroke1 = new BasicStroke(1);
- private final Font font1 = new Font("BankGothic Md BT", 1, 32);
- private final Font font2 = new Font("BankGothic Md BT", 0, 14);
- private final Font font3 = new Font("BankGothic Md BT", 0, 13);
- //END: Code generated using Enfilade's Easel
- public void onRepaint(Graphics g) {
- expGained = skills.getCurrentExp(skills.MINING) - startExp;
- /*
- * -----Time Declaration-----
- */
- long millis = System.currentTimeMillis() - startTime;
- long hours = millis / (1000 * 60 * 60);
- millis -= hours * (1000 * 60 * 60);
- long minutes = millis / (1000 * 60);
- millis -= minutes * (1000 * 60);
- long seconds = millis / 1000;
- float xpsec = 0;
- if((minutes > 0 || hours > 0 || seconds > 0) && expGained > 0) {
- xpsec = ((float) expGained)/(float)(seconds + (minutes*60) + (hours*60*60));
- }
- float xpmin = xpsec * 60;
- float xphour = xpmin * 60;
- /*
- * -----Ores & Time-----
- */
- float addyoresec = 0;
- if((minutes > 0 || hours > 0 || seconds > 0) && addyMined > 0) {
- addyoresec = ((float) addyMined)/(float)(seconds + (minutes*60) + (hours*60*60));
- }
- float addyoremin = addyoresec * 60;
- float addyorehour = addyoremin * 60;
- float mithoresec = 0;
- if((minutes > 0 || hours > 0 || seconds > 0) && mithMined > 0) {
- mithoresec = ((float) mithMined)/(float)(seconds + (minutes*60) + (hours*60*60));
- }
- float mithoremin = mithoresec * 60;
- float mithorehour = mithoremin * 60;
- float coaloresec = 0;
- if((minutes > 0 || hours > 0 || seconds > 0) && coalMined > 0) {
- coaloresec = ((float) coalMined)/(float)(seconds + (minutes*60) + (hours*60*60));
- }
- float coaloremin = coaloresec * 60;
- float coalorehour = coaloremin * 60;
- float ironoresec = 0;
- if((minutes > 0 || hours > 0 || seconds > 0) && ironMined > 0) {
- ironoresec = ((float) ironMined)/(float)(seconds + (minutes*60) + (hours*60*60));
- }
- float ironoremin = ironoresec * 60;
- float ironorehour = ironoremin * 60;
- /*
- * -----The Actual Paint-----
- */
- Graphics2D g1 = (Graphics2D)g;
- // Hide/Show Paint
- if(showPaint) {
- g1.setColor(color5);
- g1.fillRect(393, 308, 100, 27);
- g1.setFont(font2);
- g1.setColor(color4);
- g1.drawString("Hide Paint", 400, 325);
- g1.setColor(color1);
- g1.fillRect(8, 345, 487, 112);
- g1.setColor(color2);
- g1.setStroke(stroke1);
- g1.drawRect(8, 345, 487, 112);
- g1.setFont(font1);
- g1.setColor(color3);
- g1.drawString("AMCMiner v" + scriptM.version() + "!", 10, 370);
- g1.setFont(font2);
- g1.setColor(color4);
- g1.drawString("Runtime: " + hours + ":" + minutes + ":" + seconds, 10, 385);
- if(powerMine) {
- g1.drawString("Profit Made: 0 (PowerMining)", 10, 400);
- } else {
- g1.drawString("Profit Made: " + (addyMined*addyPrice + mithMined*mithPrice + coalMined*coalPrice), 10, 400);
- }
- if(!status1.equals("Iron")) {
- g1.drawString("AMC/h: " + (int)addyorehour + " - " + (int)mithorehour + " - " + (int)coalorehour, 10, 415);
- g1.drawString("AMC Mined: " + addyMined + " - " + mithMined + " - " + coalMined, 10, 430);
- } else {
- g1.drawString("Iron/h: " + (int)ironorehour, 10, 415);
- g1.drawString("Iron Mined: " + ironMined, 10, 430);
- }
- g1.drawString("Exp/h: " + (int)xphour, 240, 385);
- g1.drawString("Exp Gained: " + expGained, 240, 400);
- g1.drawString("Exp To Level: " + skills.getExpToNextLevel(skills.MINING), 240, 415);
- final int percentBar = (int) (skills.getPercentToNextLevel(skills.MINING)*4.2 / 2);
- g1.setColor(Color.RED);
- g1.fillRoundRect(240, 430, 200, 10, 15, 15);
- g1.setColor(Color.GREEN);
- g1.fillRoundRect(240, 430, percentBar, 10, 15, 15);
- g1.setColor(Color.BLACK);
- g1.drawString("" + skills.getPercentToNextLevel(skills.MINING) + "% " + "To " + (1 + skills.getCurrentLevel(skills.MINING)), 305, 439);
- g1.drawRoundRect(240, 430, 200, 10, 15, 15);
- g1.drawRoundRect(240, 430, percentBar, 10, 15, 15);
- // g1.drawString("Percent To Level: " + skills.getPercentToNextLevel(skills.MINING), 240, 430);
- g1.setFont(font3);
- g1.setColor(color3);
- g1.drawString("Rickk12345", 400, 453);
- g1.drawString("Status: " + status, 10, 453);
- } else {
- if(!showPaint) {
- g1.setColor(color5);
- g1.fillRect(393, 308, 100, 27);
- g1.setFont(font2);
- g1.setColor(color4);
- g1.drawString("Show Paint", 400, 325);
- }
- }
- }
- /*
- * -----Message Listener-----
- */
- @Override
- public void messageReceived(MessageEvent e) {
- // Paint
- String txt = e.getMessage();
- if(txt.contains("You manage to mine some mithril.")) {
- mithMined++;
- }
- String txta = e.getMessage();
- if(txta.contains("You manage to mine some coal.")) {
- coalMined++;
- }
- String txtb = e.getMessage();
- if(txtb.contains("You manage to mine some adamantite.")) {
- addyMined++;
- }
- String txtc = e.getMessage();
- if(txtc.contains("You just found a")) {
- gemsFound++;
- }
- String txtd = e.getMessage();
- if(txtd.contains("You manage to mine some iron.")) {
- ironMined++;
- }
- }
- /*
- * -----AntiBan-----
- */
- private final void antiBan() {
- status = "Doing AntiBan.";
- int r = random(1, 7);
- switch(r) {
- case 2:
- mouse.moveSlightly();
- sleep(400, 600);
- break;
- case 3:
- mouse.moveRandomly(10,50);
- break;
- case 4:
- sleep(800, 8000);
- break;
- case 5:
- mouse.moveOffScreen();
- sleep(3000, 5000);
- break;
- case 6:
- camera.moveRandomly(random(500, 1500));
- break;
- }
- }
- /*
- * -----GUI-----
- */
- class AMCgui2 extends JFrame {
- public AMCgui2() {
- initComponents();
- }
- private void button1ActionPerformed(ActionEvent e) {
- if(tree1.getLastSelectedPathComponent().toString().contains("Lumbridge West Swamp (Addy, Mith, Coal)B")) {
- bankMode = true;
- powerMine = false;
- TILE_TO_BANK = TILE_TO_BANK_LUM;
- TILE_TO_MINE = TILE_TO_MINE_LUM;
- status1 = "Addy";
- status2 = "Mith";
- status3 = "Coal";
- chosenOre = ADDY_ID;
- chosenOre2 = MITH_ID;
- chosenOre3 = COAL_ID;
- chosenInvOre = ADDY_INV_ID;
- chosenInvOre2 = MITH_INV_ID;
- chosenInvOre3 = COAL_INV_ID;
- mine = lumMine;
- alk = false;
- guiWait = false;
- g.dispose();
- } else {
- if(tree1.getLastSelectedPathComponent().toString().equals("Al Kharid (Addy, Mith, Coal)B")) {
- bankMode = true;
- powerMine = false;
- TILE_TO_BANK = TILE_TO_BANK_ALK;
- TILE_TO_MINE = TILE_TO_MINE_ALK_AMC1;
- status1 = "Addy";
- status2 = "Mith";
- status3 = "Coal";
- chosenOre = ADDY_ID;
- chosenOre2 = MITH_ID;
- chosenOre3 = COAL_ID;
- chosenInvOre = ADDY_INV_ID;
- chosenInvOre2 = MITH_INV_ID;
- chosenInvOre3 = COAL_INV_ID;
- mine = alkMine;
- alk = true;
- guiWait = false;
- g.dispose();
- } else {
- if(tree1.getLastSelectedPathComponent().toString().equals("Al Kharid (Iron)B")) {
- bankMode = true;
- powerMine = false;
- TILE_TO_BANK = TILE_TO_BANK_ALK;
- TILE_TO_MINE = TILE_TO_MINE_ALK_IRON;
- status1 = "Iron";
- status2 = "Iron";
- status3 = "Iron";
- chosenOre = IRON_ID;
- chosenOre2 = IRON_ID;
- chosenOre3 = IRON_ID;
- chosenInvOre = IRON_INV_ID;
- chosenInvOre2 = IRON_INV_ID;
- chosenInvOre3 = IRON_INV_ID;
- mine = alkMine;
- alk = true;
- guiWait = false;
- g.dispose();
- } else {
- if(tree1.getLastSelectedPathComponent().toString().equals("East Varrock (Iron)B")) {
- bankMode = false;
- powerMine = true;
- TILE_TO_BANK = TILE_TO_BANK_EVAR;
- TILE_TO_MINE = TILE_TO_MINE_EVAR;
- status1 = "Iron";
- status2 = "Iron";
- status3 = "Iron";
- chosenOre = IRON_ID;
- chosenOre2 = IRON_ID;
- chosenOre3 = IRON_ID;
- chosenInvOre = IRON_INV_ID;
- chosenInvOre2 = IRON_INV_ID;
- chosenInvOre3 = IRON_INV_ID;
- mine = eVarMine;
- alk = false;
- guiWait = false;
- g.dispose();
- } else {
- if(tree1.getLastSelectedPathComponent().toString().equals("Lumbridge West Swamp (Addy, Mith, Coal)P")) {
- bankMode = false;
- powerMine = true;
- status1 = "Addy";
- status2 = "Mith";
- status3 = "Coal";
- chosenOre = ADDY_ID;
- chosenOre2 = MITH_ID;
- chosenOre3 = COAL_ID;
- chosenInvOre = ADDY_INV_ID;
- chosenInvOre2 = MITH_INV_ID;
- chosenInvOre3 = COAL_INV_ID;
- mine = lumMine;
- alk = false;
- guiWait = false;
- g.dispose();
- } else {
- if(tree1.getLastSelectedPathComponent().toString().equals("Al Kharid (Addy, Mith, Coal)P")) {
- bankMode = false;
- powerMine = true;
- status1 = "Addy";
- status2 = "Mith";
- status3 = "Coal";
- chosenOre = ADDY_ID;
- chosenOre2 = MITH_ID;
- chosenOre3 = COAL_ID;
- chosenInvOre = ADDY_INV_ID;
- chosenInvOre2 = MITH_INV_ID;
- chosenInvOre3 = COAL_INV_ID;
- mine = alkMine;
- alk = true;
- guiWait = false;
- g.dispose();
- } else {
- if(tree1.getLastSelectedPathComponent().toString().equals("Al Kharid (Iron)P")) {
- bankMode = false;
- powerMine = true;
- status1 = "Iron";
- status2 = "Iron";
- status3 = "Iron";
- chosenOre = IRON_ID;
- chosenOre2 = IRON_ID;
- chosenOre3 = IRON_ID;
- chosenInvOre = IRON_INV_ID;
- chosenInvOre2 = IRON_INV_ID;
- chosenInvOre3 = IRON_INV_ID;
- mine = alkMine;
- alk = true;
- guiWait = false;
- g.dispose();
- } else {
- if(tree1.getLastSelectedPathComponent().toString().equals("East Varrock (Iron)P")) {
- bankMode = false;
- powerMine = true;
- status1 = "Iron";
- status2 = "Iron";
- status3 = "Iron";
- chosenOre = IRON_ID;
- chosenOre2 = IRON_ID;
- chosenOre3 = IRON_ID;
- chosenInvOre = IRON_INV_ID;
- chosenInvOre2 = IRON_INV_ID;
- chosenInvOre3 = IRON_INV_ID;
- alk = false;
- mine = eVarMine;
- guiWait = false;
- g.dispose();
- } else {
- if(tree1.getLastSelectedPathComponent().toString().equals("... (Coal)B")) {
- bankMode = true;
- powerMine = false;
- TILE_TO_BANK = TILE_TO_BANK_LUM;
- TILE_TO_MINE = TILE_TO_MINE_LUM;
- status1 = "Coal";
- status2 = "Coal";
- status3 = "Coal";
- chosenOre = COAL_ID;
- chosenOre2 = COAL_ID;
- chosenOre3 = COAL_ID;
- chosenInvOre = COAL_INV_ID;
- chosenInvOre2 = COAL_INV_ID;
- chosenInvOre3 = COAL_INV_ID;
- alk = false;
- mine = lumMine;
- guiWait = false;
- g.dispose();
- } else {
- if(tree1.getLastSelectedPathComponent().toString().equals("Lumbridge West Swamp (Coal)P")) {
- bankMode = false;
- powerMine = true;
- status1 = "Coal";
- status2 = "Coal";
- status3 = "Coal";
- chosenOre = COAL_ID;
- chosenOre2 = COAL_ID;
- chosenOre3 = COAL_ID;
- chosenInvOre = COAL_INV_ID;
- chosenInvOre2 = COAL_INV_ID;
- chosenInvOre3 = COAL_INV_ID;
- alk = false;
- mine = lumMine;
- guiWait = false;
- g.dispose();
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- private void initComponents() {
- scrollPane1 = new JScrollPane();
- tree1 = new JTree();
- label1 = new JLabel();
- button1 = new JButton();
- //======== this ========
- setTitle("AMCMiner v" + scriptM.version() + "!");
- setFont(new Font("BankGothic Md BT", Font.BOLD, 18));
- Container contentPane = getContentPane();
- //======== scrollPane1 ========
- {
- //---- tree1 ----
- tree1.setModel(new DefaultTreeModel(
- new DefaultMutableTreeNode("Locations & Ores") {
- {
- DefaultMutableTreeNode node1 = new DefaultMutableTreeNode("Banking");
- node1.add(new DefaultMutableTreeNode("Lumbridge West Swamp (Addy, Mith, Coal)B"));
- node1.add(new DefaultMutableTreeNode("Al Kharid (Addy, Mith, Coal)B"));
- node1.add(new DefaultMutableTreeNode("Al Kharid (Iron)B"));
- node1.add(new DefaultMutableTreeNode("East Varrock (Iron)B"));
- node1.add(new DefaultMutableTreeNode("Lumbridge West Swamp (Coal)B"));
- add(node1);
- node1 = new DefaultMutableTreeNode("Powermining");
- node1.add(new DefaultMutableTreeNode("Lumbridge West Swamp (Addy, Mith, Coal)P"));
- node1.add(new DefaultMutableTreeNode("Al Kharid (Addy, Mith, Coal)P"));
- node1.add(new DefaultMutableTreeNode("Al Kharid (Iron)P"));
- node1.add(new DefaultMutableTreeNode("East Varrock (Iron)P"));
- node1.add(new DefaultMutableTreeNode("Lumbridge West Swamp (Coal)P"));
- add(node1);
- }
- }));
- tree1.setFont(new Font("BankGothic Md BT", Font.BOLD, 20));
- scrollPane1.setViewportView(tree1);
- }
- //---- label1 ----
- label1.setText("AMCMiner v" + scriptM.version() + "!");
- label1.setFont(new Font("BankGothic Md BT", Font.BOLD, 60));
- //---- button1 ----
- button1.setText("Start!");
- button1.setFont(new Font("BankGothic Md BT", Font.BOLD, 20));
- button1.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- button1ActionPerformed(e);
- }
- });
- GroupLayout contentPaneLayout = new GroupLayout(contentPane);
- contentPane.setLayout(contentPaneLayout);
- contentPaneLayout.setHorizontalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(74, 74, 74)
- .addComponent(label1)
- .addContainerGap(76, Short.MAX_VALUE))
- .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
- .addContainerGap(293, Short.MAX_VALUE)
- .addComponent(button1, GroupLayout.PREFERRED_SIZE, 151, GroupLayout.PREFERRED_SIZE)
- .addGap(285, 285, 285))
- .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(scrollPane1, GroupLayout.DEFAULT_SIZE, 709, Short.MAX_VALUE)
- .addContainerGap())
- );
- contentPaneLayout.setVerticalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(label1)
- .addGap(18, 18, 18)
- .addComponent(scrollPane1, GroupLayout.PREFERRED_SIZE, 167, GroupLayout.PREFERRED_SIZE)
- .addGap(18, 18, 18)
- .addComponent(button1, GroupLayout.DEFAULT_SIZE, 65, Short.MAX_VALUE)
- .addContainerGap())
- );
- pack();
- setLocationRelativeTo(getOwner());
- }
- private JScrollPane scrollPane1;
- private JTree tree1;
- private JLabel label1;
- private JButton button1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement