Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 10th, 2012  |  syntax: None  |  size: 26.96 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import java.awt.Color;
  2. import java.awt.Font;
  3. import java.awt.Graphics;
  4. import java.awt.Graphics2D;
  5. import java.awt.RenderingHints;
  6. import java.util.Map;
  7. import org.rsbot.bot.Bot;
  8. import org.rsbot.bot.input.CanvasWrapper;
  9. import org.rsbot.event.events.ServerMessageEvent;
  10. import org.rsbot.event.listeners.PaintListener;
  11. import org.rsbot.event.listeners.ServerMessageListener;
  12. import org.rsbot.script.Constants;
  13. import org.rsbot.script.Script;
  14. import org.rsbot.script.ScriptManifest;
  15. import org.rsbot.script.wrappers.RSInterface;
  16. import org.rsbot.script.wrappers.RSObject;
  17. import org.rsbot.script.wrappers.RSTile;
  18.  
  19. /**
  20.  *
  21.  * @author Ramus
  22.  */
  23. @ScriptManifest(authors = "Ramus", category = "Mining", version = 1.2, name = "Ramus' AIO Miner")
  24. public class RamusAIOMiner extends Script implements PaintListener, ServerMessageListener {
  25.  
  26.     public int[] Copper = {11938, 11936, 11963, 11937, 9709, 9708, 9710, 11960, 11962, 11961, 31080, 31082};
  27.     public int[] Tin = {11935, 11934, 11933, 11959, 11957, 11959, 11958, 9714, 9716, 31079, 31077, 31078};
  28.     public int[] Clay = {711, 9713, 15503, 15504, 15505, 31062, 31063};
  29.     public int[] Iron = {2093, 2093, 2092, 9717, 9719, 9717, 9718, 11956, 11955, 11954, 37307, 37309, 31072, 31073, 31071, 37308};
  30.     public int[] Silver = {37305, 37304, 37306, 9714, 9716, 9713, 11950, 11949, 11948, 11950};
  31.     public int[] Gold = {37312, 37310, 9722, 9720, 15505, 15503, 11185, 11184, 11183, 9720, 9722, 37313, 31065, 31066};
  32.     public int[] Granite = {10947};
  33.     public int[] Sandstone = {10946};
  34.     public int[] Coal = {11930, 11931, 11932, 11930, 11963, 11964, 2096, 2097, 14850, 14851, 14852, 32426, 32426, 31068, 31069, 31070, 31068};
  35.     public int[] Mithril = {11942, 11944, 11943, 32438, 32439, 31086, 31087, 31088};
  36.     public int[] Adamant = {11939, 11941, 32435, 32436, 11940, 31083, 31084, 31085, 31083};
  37.     public int[] LivingGold = {45076};
  38.     public int[] Runite = {451};
  39.     public int[] Pickaxes = {1265, 1275, 1269, 1271, 1273, 1267};
  40.     public int standingCount = 0;
  41.     public RSTile oldPosition = new RSTile(0, 0);
  42.     public int mined;
  43.     public int gems;
  44.     public int[] Gems = {1617, 1619, 1621, 1623};
  45.     public double expGained = 0;
  46.     public int copperID = 436;
  47.     public int tinID = 438;
  48.     public int clayID = 434;
  49.     public int ironID = 440;
  50.     public int silverID = 442;
  51.     public int goldID = 444;
  52.     public int[] graniteID = {6979, 6981, 6983};
  53.     public int[] sandstoneID = {6971, 6973, 6975, 6977};
  54.     public int coalID = 453;
  55.     public int mithrilID = 447;
  56.     public int adamantID = 449;
  57.     public int runiteID = 451;
  58.     public int[] rock;
  59.     public static boolean pm = false;
  60.     public static boolean m1d1 = false;
  61.     public static boolean startScript = false;
  62.     public int drop;
  63.     public int[] dropgs = null;
  64.     public long startTime = System.currentTimeMillis();
  65.     private String status = "Starting Up...";
  66.     RSTile[] walkToBank;
  67.     RSTile[] walkToMine;
  68.     RSTile bankTile;
  69.     RSTile mineTile;
  70.     public int bankID;
  71.     public int checkTime;
  72.     public long lastCheck;
  73.     //START GUI
  74.     public static String Ore;
  75.     public static String Loc;
  76.     //END GUI
  77.  
  78.     @Override
  79.     public boolean onStart(Map<String, String> args) {
  80.         new GUI().setVisible(true);
  81.         status = "Loading GUI Settings...";
  82.  
  83.         while (!startScript) {
  84.             wait(10);
  85.         }
  86.  
  87.         if (startScript) {
  88.             if (Loc.contains("Al Kharid")) {
  89.                 bankID = 35647;
  90.                 bankTile = new RSTile(3269, 3168);
  91.                 mineTile = new RSTile(3300, 3304);
  92.                 walkToMine = new RSTile[]{new RSTile(3269, 3167),
  93.                             new RSTile(3277, 3175), new RSTile(3282, 3189),
  94.                             new RSTile(3283, 3204), new RSTile(3289, 3217),
  95.                             new RSTile(3291, 3233), new RSTile(3292, 3249),
  96.                             new RSTile(3295, 3264), new RSTile(3293, 3278),
  97.                             new RSTile(3299, 3294), new RSTile(3298, 3301)};
  98.                 walkToBank = reversePath(walkToMine);
  99.             }
  100.             if (Loc.contains("Hobgoblin")) {
  101.                 bankID = 39830;
  102.                 bankTile = new RSTile(3137, 3628);
  103.                 mineTile = new RSTile(3023, 3799);
  104.                 walkToMine = new RSTile[]{new RSTile(3023, 3799),
  105.                             new RSTile(3030, 3786), new RSTile(3040, 3775),
  106.                             new RSTile(3045, 3761), new RSTile(3057, 3754),
  107.                             new RSTile(3068, 3742), new RSTile(3069, 3726),
  108.                             new RSTile(3071, 3712), new RSTile(3071, 3698),
  109.                             new RSTile(3066, 3682), new RSTile(3068, 3670),
  110.                             new RSTile(3070, 3659), new RSTile(3076, 3651),
  111.                             new RSTile(3089, 3649), new RSTile(3105, 3647),
  112.                             new RSTile(3118, 3643), new RSTile(3121, 3637),
  113.                             new RSTile(3134, 3631), new RSTile(3137, 3628)};
  114.                 walkToBank = reversePath(walkToMine);
  115.             }
  116.             if (Loc.contains("Living Rock")) {
  117.                 bankID = 45079;
  118.                 bankTile = new RSTile(3654, 5112);
  119.                 mineTile = new RSTile(3669, 5076);
  120.                 walkToMine = new RSTile[]{new RSTile(3654, 5112),
  121.                             new RSTile(3657, 5101), new RSTile(3666, 5089),
  122.                             new RSTile(3669, 5078), new RSTile(3669, 5076)};
  123.                 walkToBank = reversePath(walkToMine);
  124.             }
  125.             if (Loc.contains("Lumbridge")) {
  126.                 bankID = 2213;
  127.                 bankTile = new RSTile(3092, 3244);
  128.                 mineTile = new RSTile(3147, 3149);
  129.                 walkToMine = reversePath(walkToBank);
  130.                 walkToBank = new RSTile[]{new RSTile(3146, 3148),
  131.                             new RSTile(3149, 3158), new RSTile(3144, 3167),
  132.                             new RSTile(3141, 3181), new RSTile(3140, 3194),
  133.                             new RSTile(3136, 3207), new RSTile(3121, 3211),
  134.                             new RSTile(3112, 3222), new RSTile(3106, 3235),
  135.                             new RSTile(3093, 3243)};
  136.             }
  137.             if (Loc.contains("Rimmington")) {
  138.                 bankID = 11758;
  139.                 bankTile = new RSTile(3012, 3355);
  140.                 mineTile = new RSTile(2976, 3240);
  141.                 walkToBank = new RSTile[]{new RSTile(2976, 3240),
  142.                             new RSTile(2975, 3249), new RSTile(2977, 3263),
  143.                             new RSTile(2981, 3274), new RSTile(2987, 3288),
  144.                             new RSTile(2995, 3302), new RSTile(2999, 3311),
  145.                             new RSTile(3007, 3320), new RSTile(3008, 3333),
  146.                             new RSTile(3007, 3346), new RSTile(3012, 3355)};
  147.                 walkToMine = reversePath(walkToBank);
  148.             }
  149.             if (Loc.contains("Varrock East")) {
  150.                 bankID = 11402;
  151.                 bankTile = new RSTile(3253, 3420);
  152.                 mineTile = new RSTile(3286, 3365);
  153.                 walkToMine = new RSTile[]{new RSTile(3253, 3420),
  154.                             new RSTile(3262, 3428), new RSTile(3275, 3427),
  155.                             new RSTile(3285, 3420), new RSTile(3290, 3408),
  156.                             new RSTile(3291, 3396), new RSTile(3293, 3385),
  157.                             new RSTile(3291, 3374), new RSTile(3285, 3365)};
  158.                 walkToBank = reversePath(walkToMine);
  159.             }
  160.             if (Loc.contains("Varrock West")) {
  161.                 bankID = 11402;
  162.                 bankTile = new RSTile(3182, 3438);
  163.                 mineTile = new RSTile(3180, 3371);
  164.                 walkToMine = new RSTile[]{new RSTile(3184, 3437),
  165.                             new RSTile(3183, 3429), new RSTile(3173, 3426),
  166.                             new RSTile(3172, 3414), new RSTile(3171, 3401),
  167.                             new RSTile(3176, 3389), new RSTile(3182, 3380),
  168.                             new RSTile(3181, 3371)};
  169.                 walkToBank = reversePath(walkToMine);
  170.             }
  171.             if (Loc.contains("Yanille")) {
  172.                 bankID = 2213;
  173.                 bankTile = new RSTile(2612, 3092);
  174.                 mineTile = new RSTile(2629, 3139);
  175.                 walkToBank = new RSTile[]{new RSTile(2627, 3141),
  176.                             new RSTile(2625, 3131), new RSTile(2625, 3120),
  177.                             new RSTile(2619, 3110), new RSTile(2609, 3100),
  178.                             new RSTile(2612, 3092)};
  179.                 walkToMine = new RSTile[]{new RSTile(2613, 3092),
  180.                             new RSTile(2610, 3101), new RSTile(2620, 3111),
  181.                             new RSTile(2624, 3121), new RSTile(2624, 3131),
  182.                             new RSTile(2629, 3139)};
  183.             }
  184.             if (Loc.contains("Power")) {
  185.                 pm = true;
  186.             }
  187.             if (Loc.contains("Mine 1")) {
  188.                 m1d1 = true;
  189.             }
  190.  
  191.             if (Ore.contains("Mineral Deposit (Gold)")) {
  192.                 rock = LivingGold;
  193.                 drop = goldID;
  194.             }
  195.  
  196.             if (Ore.contains("Copper")) {
  197.                 rock = Copper;
  198.                 drop = copperID;
  199.             }
  200.             if (Ore.contains("Tin")) {
  201.                 rock = Tin;
  202.                 drop = tinID;
  203.             }
  204.             if (Ore.contains("Clay")) {
  205.                 rock = Clay;
  206.                 drop = clayID;
  207.             }
  208.             if (Ore.contains("Iron")) {
  209.                 rock = Iron;
  210.                 drop = ironID;
  211.             }
  212.             if (Ore.contains("Silver")) {
  213.                 rock = Silver;
  214.                 drop = silverID;
  215.             }
  216.             if (Ore.contains("Gold")) {
  217.                 rock = Gold;
  218.                 drop = goldID;
  219.             }
  220.             if (Ore.contains("Granite")) {
  221.                 rock = Granite;
  222.                 dropgs = graniteID;
  223.             }
  224.             if (Ore.contains("Sandstone")) {
  225.                 rock = Sandstone;
  226.                 dropgs = sandstoneID;
  227.             }
  228.             if (Ore.contains("Coal")) {
  229.                 rock = Coal;
  230.                 drop = coalID;
  231.             }
  232.             if (Ore.contains("Mithril")) {
  233.                 rock = Mithril;
  234.                 drop = mithrilID;
  235.             }
  236.             if (Ore.contains("Adamant")) {
  237.                 rock = Adamant;
  238.                 drop = adamantID;
  239.             }
  240.             if (Ore.contains("Runite")) {
  241.                 rock = Runite;
  242.                 drop = runiteID;
  243.             }
  244.         }
  245.         return true;
  246.     }
  247.  
  248.     @Override
  249.     protected int getMouseSpeed() {
  250.         return 5;
  251.     }
  252.  
  253.     @Override
  254.     public int loop() {
  255.         if (isLoggedIn()) {
  256.  
  257.             if (!isInventoryFull() && bank.isOpen()) {
  258.                 bank.close();
  259.             }
  260.  
  261.             if (getEnergy() > random(50, 100)) {
  262.                 setRun(true);
  263.             }
  264.  
  265.             if (!getMyPlayer().isMoving()) {
  266.                 standingStill();
  267.             }
  268.  
  269.             if (getMyPlayer().isInCombat()) {
  270.                 if (distanceTo(bankTile) < 5) {
  271.                     if (!walkPathMM(walkToMine)) {
  272.                         walkToClosestTile(walkToMine);
  273.                         status = "Running Away...";
  274.                     }
  275.                 } else if (distanceTo(mineTile) < 5) {
  276.                     if (!walkPathMM(walkToBank)) {
  277.                         walkToClosestTile(walkToBank);
  278.                         status = "Running Away...";
  279.                     }
  280.                 }
  281.             }
  282.  
  283.             if (getMyPlayer().isMoving()) {
  284.                 return antiBan();
  285.             }
  286.  
  287.             if (!isInventoryFull() && distanceTo(mineTile) < 8) {
  288.                 mineOre();
  289.             }
  290.             if (!isInventoryFull() && distanceTo(mineTile) >= 8) {
  291.                 walkToMine();
  292.             }
  293.             if (isInventoryFull() && distanceTo(bankTile) < 8) {
  294.                 bank();
  295.             }
  296.             if (isInventoryFull() && distanceTo(bankTile) >= 8) {
  297.                 walkToBank();
  298.             }
  299.             if (pm) {
  300.                 if (!isInventoryFull()) {
  301.                     mineOre();
  302.                 } else if (isInventoryFull()) {
  303.                     dropAllExcept(Pickaxes);
  304.                 }
  305.             }
  306.             if (m1d1) {
  307.                 if (dropgs == null) {
  308.                     if (getInventoryCount(drop) < 2) {
  309.                         mineOre();
  310.                     } else if (getInventoryCount(drop) >= 2) {
  311.                         dropAllExcept(Pickaxes);
  312.                     }
  313.                 } else if (dropgs != null) {
  314.                     if (getInventoryCount(dropgs) < 2) {
  315.                         mineOre();
  316.                     } else if (getInventoryCount(dropgs) >= 2) {
  317.                         dropAllExcept(Pickaxes);
  318.                     }
  319.                 }
  320.             }
  321.             return antiBan();
  322.         }
  323.         return (random(50, 100));
  324.     }
  325.  
  326.     public void walk(RSTile tile, RSTile[] path) {
  327.         if (distanceTo(tile) >= 8) {
  328.             if (!getMyPlayer().isMoving() || (getDestination() != null && distanceTo(getDestination()) < 7)) {
  329.                 walkPathMM(randomizePath(path, 2, 2), 15);
  330.             }
  331.         }
  332.     }
  333.  
  334.     public void walkToMine() {
  335.         walk(mineTile, walkToMine);
  336.         status = "Walking To Mine...";
  337.     }
  338.  
  339.     private void openBank() {
  340.         final RSObject Bank = getNearestObjectByID(bankID);
  341.         if (!bank.isOpen()) {
  342.             if (!tileOnScreen(Bank.getLocation())) {
  343.                 wait(random(50, 100));
  344.                 turnToTile(Bank.getLocation(), 15);
  345.             }
  346.             if (Loc.contains("Living Rock") || Loc.contains("Hobgoblin")) {
  347.                 atObject(Bank, "Deposit");
  348.                 status = "Opening Bank...";
  349.                 if (RSInterface.getInterface(11).getChild(18).isValid()) {
  350.                     moveMouse(345, 275);
  351.                     wait(random(100, 300));
  352.                     clickMouse(true);
  353.                 }
  354.             }
  355.             atObject(Bank, "Use-quickly");
  356.             status = "Opening Bank...";
  357.         } else if (bank.isOpen()) {
  358.             bank();
  359.         }
  360.     }
  361.  
  362.     public void bank() {
  363.         if (RSInterface.getInterface(Constants.INTERFACE_BANK).isValid()) {
  364.             bank.depositAllExcept(Pickaxes);
  365.             status = "Banking...";
  366.         } else {
  367.             openBank();
  368.         }
  369.     }
  370.  
  371.     public void walkToBank() {
  372.         walk(bankTile, walkToBank);
  373.         status = "Walking To Bank...";
  374.     }
  375.  
  376.     private boolean mineOre() {
  377.         RSObject Rock = getNearestObjectByID(rock);
  378.         if (Rock != null) {
  379.             atObject(Rock, "Mine");
  380.             status = "Mining...";
  381.             waitForAnim(2750);
  382.             while (!animationIs(-1)) {
  383.                 wait(200);
  384.             }
  385.         }
  386.         if (Rock == null) {
  387.             return false;
  388.         }
  389.         return true;
  390.     }
  391.  
  392.     private int antiBan() {
  393.         final int gamble = random(1, 12);
  394.  
  395.         switch (gamble) {
  396.             case 1:
  397.                 return random(500, 750);
  398.  
  399.             case 2:
  400.                 final int x = random(0, 750);
  401.                 final int y = random(0, 500);
  402.                 moveMouse(0, 0, x, y);
  403.                 return random(500, 750);
  404.  
  405.             case 3:
  406.                 openTab(Constants.TAB_INVENTORY);
  407.                 return random(500, 750);
  408.  
  409.             case 4:
  410.                 if (getMyPlayer().isMoving()) {
  411.                     return random(750, 1000);
  412.                 }
  413.  
  414.                 if (System.currentTimeMillis() - lastCheck >= checkTime) {
  415.                     lastCheck = System.currentTimeMillis();
  416.                     checkTime = random(60000, 180000);
  417.  
  418.                     if (getCurrentTab() != Constants.TAB_STATS) {
  419.                         openTab(Constants.TAB_STATS);
  420.                     }
  421.                     moveMouse(675, 210, 55, 25);
  422.                     return random(5000, 8000);
  423.                 }
  424.  
  425.             case 5:
  426.                 if (random(1, 8) == 2) {
  427.                     int angle = getCameraAngle() + random(-90, 90);
  428.                     if (angle < 0) {
  429.                         angle = 0;
  430.                     }
  431.                     if (angle > 359) {
  432.                         angle = 0;
  433.                     }
  434.  
  435.                     setCameraRotation(angle);
  436.                 }
  437.  
  438.             case 6:
  439.                 Thread camera = new Thread() {
  440.  
  441.                     @Override
  442.                     public void run() {
  443.                         char dir = 37;
  444.                         if (random(0, 3) == 2) {
  445.                             dir = 39;
  446.                         }
  447.                         Bot.getInputManager().pressKey(dir);
  448.                         try {
  449.                             Thread.sleep(random(500, 2000));
  450.                         } catch (InterruptedException e) {
  451.                             e.printStackTrace();
  452.                         }
  453.                         Bot.getInputManager().releaseKey(dir);
  454.                     }
  455.                 };
  456.  
  457.                 Thread mouse = new Thread() {
  458.  
  459.                     @Override
  460.                     public void run() {
  461.                         moveMouse(random(0, CanvasWrapper.getGameWidth()), random(0, CanvasWrapper.getGameHeight()));
  462.                     }
  463.                 };
  464.                 camera.start();
  465.                 mouse.start();
  466.                 while (camera.isAlive() || mouse.isAlive()) {
  467.                     wait(random(100, 300));
  468.                 }
  469.                 break;
  470.         }
  471.         return random(500, 750);
  472.     }
  473.  
  474.     public void rotate() {
  475.         final int button = random(37, 40);
  476.         Bot.getInputManager().pressKey((char) button);
  477.         wait(random(500, 1500));
  478.         Bot.getInputManager().releaseKey((char) button);
  479.     }
  480.  
  481.     public void standingStill() {
  482.         if (oldPosition.getX() == getMyPlayer().getLocation().getX() && oldPosition.getY() == getMyPlayer().getLocation().getY()) {
  483.             standingCount++;
  484.         }
  485.         if (oldPosition.getX() != getMyPlayer().getLocation().getX() && oldPosition.getY() != getMyPlayer().getLocation().getY()) {
  486.             oldPosition = new RSTile(getMyPlayer().getLocation().getX(), getMyPlayer().getLocation().getY());
  487.             standingCount = 0;
  488.         }
  489.         if (getMyPlayer().getInteracting() != null || getMyPlayer().getAnimation() != -1) {
  490.             standingCount = 0;
  491.         }
  492.         if (standingCount > 5 && standingCount < 20) {
  493.             rotate();
  494.         }
  495.         if (standingCount > 30) {
  496.             log("You got stuck!");
  497.         }
  498.     }
  499.  
  500.     public void onRepaint(Graphics g) {
  501.         ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  502.         ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
  503.         ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
  504.  
  505.         g.fillOval(Bot.getInputManager().getX() - 4, Bot.getInputManager().getY() - 4, 10, 10);
  506.  
  507.         if (isLoggedIn()) {
  508.  
  509.             long millis = System.currentTimeMillis() - startTime;
  510.             long runTime = millis;
  511.             long hours = millis / (1000 * 60 * 60);
  512.             millis -= hours * (1000 * 60 * 60);
  513.             long minutes = millis / (1000 * 60);
  514.             millis -= minutes * (1000 * 60);
  515.             long seconds = millis / 1000;
  516.  
  517.             final int oresPerHour = (int) (3600000.0 / runTime * mined);
  518.             final int xpPerHour = oresPerHour * 35;
  519.             final int rocksLeft = (int) Math.round(skills.getXPToNextLevel(14) / 35);
  520.  
  521.             Font H = new Font("Papyrus", Font.PLAIN, 16);
  522.             Font P = new Font("Arial", Font.PLAIN, 12);
  523.  
  524.             g.setColor(new Color(0, 0, 0, 100));
  525.             g.fillRoundRect(0, 50, 200, 290, 15, 15);
  526.             g.setColor(Color.cyan);
  527.             g.setFont(H);
  528.             g.drawString("Ramus' AIO Miner", 10, 70);
  529.  
  530.             g.setColor(Color.green);
  531.             g.setFont(P);
  532.             g.drawString("Time running: " + hours + ":" + minutes + ":" + seconds, 10, 110);
  533.             g.drawString("Current Level: " + skills.getCurrentSkillLevel(14), 10, 130);
  534.             g.drawString("Current EXP: " + skills.getCurrentSkillExp(14), 10, 150);
  535.             g.drawString("EXP Left: " + skills.getXPToNextLevel(14), 10, 170);
  536.             g.drawString("EXP Gained: " + expGained, 10, 190);
  537.             g.drawString("Ores Mined: " + mined, 10, 210);
  538.             g.drawString("Gems Mined: " + gems, 10, 230);
  539.             g.drawString("Ores / Hour: " + oresPerHour, 10, 250);
  540.             g.drawString("XP / Hour: " + xpPerHour, 10, 270);
  541.             g.drawString("Rocks Left: " + rocksLeft, 10, 290);
  542.             g.drawString(status, 10, 320);
  543.         }
  544.     }
  545.  
  546.     public void serverMessageRecieved(final ServerMessageEvent e) {
  547.         final String word = e.getMessage().toLowerCase();
  548.         if (word.contains("manage to mine") && word.contains("tin")) {
  549.             mined++;
  550.             expGained = expGained + 17.5;
  551.         }
  552.         if (word.contains("manage to mine") && word.contains("copper")) {
  553.             mined++;
  554.             expGained = expGained + 17.5;
  555.         }
  556.         if (word.contains("manage to mine") && word.contains("clay")) {
  557.             mined++;
  558.             expGained = expGained + 5;
  559.         }
  560.         if (word.contains("manage to mine") && word.contains("iron")) {
  561.             mined++;
  562.             expGained = expGained + 35;
  563.         }
  564.         if (word.contains("manage to mine") && word.contains("silver")) {
  565.             mined++;
  566.             expGained = expGained + 40;
  567.         }
  568.         if (word.contains("manage to mine") && word.contains("coal")) {
  569.             mined++;
  570.             expGained = expGained + 50;
  571.         }
  572.         if (word.contains("manage to mine") && word.contains("gold")) {
  573.             mined++;
  574.             expGained = expGained + 65;
  575.         }
  576.         if (word.contains("manage to mine") && word.contains("mithril")) {
  577.             mined++;
  578.             expGained = expGained + 80;
  579.         }
  580.         if (word.contains("manage to mine") && word.contains("adamant")) {
  581.             mined++;
  582.             expGained = expGained + 95;
  583.         }
  584.         if (word.contains("manage to mine") && word.contains("runite")) {
  585.             mined++;
  586.             expGained = expGained + 125;
  587.         }
  588.  
  589.         if (word.contains("died")) {
  590.             log("You have died!");
  591.             stopScript();
  592.         }
  593.         if (word.contains("you just found")) {
  594.             gems++;
  595.             expGained = expGained + 65;
  596.         }
  597.     }
  598. }
  599.  
  600. class GUI extends javax.swing.JFrame {
  601.  
  602.     public GUI() {
  603.         initComponents();
  604.     }
  605.  
  606.     @SuppressWarnings("unchecked")
  607.     // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
  608.     private void initComponents() {
  609.  
  610.         SelectLoc = new javax.swing.JComboBox();
  611.         SelectOre = new javax.swing.JComboBox();
  612.         Start = new javax.swing.JButton();
  613.  
  614.         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  615.         setTitle("Ramus' AIO Miner");
  616.         setAlwaysOnTop(true);
  617.         setName("GUI"); // NOI18N
  618.  
  619.         SelectLoc.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
  620.         SelectLoc.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Power-Mining", "Mine 2 Drop 2", "Al Kharid", "Hobgoblin Mine", "Living Rock Caverns", "Lumbridge Swamp", "Rimmington", "Varrock East", "Varrock West", "Yanille" }));
  621.  
  622.         SelectOre.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
  623.         SelectOre.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Copper", "Tin", "Clay", "Iron", "Silver", "Gold", "Granite", "Sandstone", "Coal", "Mithril", "Adamant", "Mineral Deposit (Gold)", "Runite" }));
  624.  
  625.         Start.setFont(new java.awt.Font("Arial", 0, 12));
  626.         Start.setText("Start");
  627.         Start.addActionListener(new java.awt.event.ActionListener() {
  628.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  629.                 StartActionPerformed(evt);
  630.             }
  631.         });
  632.  
  633.         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  634.         getContentPane().setLayout(layout);
  635.         layout.setHorizontalGroup(
  636.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  637.             .addGroup(layout.createSequentialGroup()
  638.                 .addContainerGap()
  639.                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
  640.                     .addComponent(Start, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  641.                     .addComponent(SelectOre, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  642.                     .addComponent(SelectLoc, javax.swing.GroupLayout.Alignment.LEADING, 0, 160, Short.MAX_VALUE))
  643.                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  644.         );
  645.         layout.setVerticalGroup(
  646.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  647.             .addGroup(layout.createSequentialGroup()
  648.                 .addContainerGap()
  649.                 .addComponent(SelectLoc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  650.                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  651.                 .addComponent(SelectOre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  652.                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  653.                 .addComponent(Start)
  654.                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  655.         );
  656.  
  657.         pack();
  658.     }// </editor-fold>                        
  659.  
  660.     private void StartActionPerformed(java.awt.event.ActionEvent evt) {                                      
  661.         RamusAIOMiner.Ore = SelectOre.getSelectedItem().toString();
  662.         RamusAIOMiner.Loc = SelectLoc.getSelectedItem().toString();
  663.         RamusAIOMiner.startScript = true;
  664.         this.setVisible(false);
  665.     }                                    
  666.  
  667.     public static void main(String args[]) {
  668.         java.awt.EventQueue.invokeLater(new Runnable() {
  669.  
  670.             public void run() {
  671.                 new GUI().setVisible(true);
  672.             }
  673.         });
  674.     }
  675.     // Variables declaration - do not modify                    
  676.     private javax.swing.JComboBox SelectLoc;
  677.     private javax.swing.JComboBox SelectOre;
  678.     private javax.swing.JButton Start;
  679.     // End of variables declaration                  
  680. }