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

Untitled

By: a guest on Jun 27th, 2012  |  syntax: None  |  size: 62.40 KB  |  hits: 7  |  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. //Version 1.06
  2.  
  3. //By Aaimister
  4. import java.util.Scanner;
  5. import java.awt.Color;
  6. import java.awt.Font;
  7. import java.awt.Graphics;
  8. import java.awt.Graphics2D;
  9. import java.awt.Point;
  10. import java.awt.RenderingHints;
  11. import java.awt.SystemColor;
  12. import java.awt.event.ActionEvent;
  13. import java.awt.event.ActionListener;
  14. import java.awt.event.KeyEvent;
  15. import java.awt.event.MouseEvent;
  16. import java.awt.event.MouseListener;
  17. import java.awt.event.WindowAdapter;
  18. import java.awt.event.WindowEvent;
  19. import java.io.*;
  20. import java.net.URL;
  21. import java.net.URLConnection;
  22. import java.text.DecimalFormat;
  23. import java.text.NumberFormat;
  24.  
  25. import javax.swing.DefaultComboBoxModel;
  26. import javax.swing.GroupLayout;
  27. import javax.swing.GroupLayout.Alignment;
  28. import javax.swing.JButton;
  29. import javax.swing.JCheckBox;
  30. import javax.swing.JComboBox;
  31. import javax.swing.JFileChooser;
  32. import javax.swing.JFrame;
  33. import javax.swing.JLabel;
  34. import javax.swing.JOptionPane;
  35. import javax.swing.JPanel;
  36. import javax.swing.JTabbedPane;
  37. import javax.swing.JTextArea;
  38. import javax.swing.LayoutStyle.ComponentPlacement;
  39. import javax.swing.SwingConstants;
  40. import javax.swing.border.EmptyBorder;
  41. import javax.swing.border.MatteBorder;
  42.  
  43. import org.rsbot.event.events.MessageEvent;
  44. import org.rsbot.event.listeners.MessageListener;
  45. import org.rsbot.event.listeners.PaintListener;
  46. import org.rsbot.script.Script;
  47. import org.rsbot.script.ScriptManifest;
  48. import org.rsbot.script.util.Filter;
  49. import org.rsbot.script.wrappers.RSArea;
  50. import org.rsbot.script.wrappers.RSGroundItem;
  51. import org.rsbot.script.wrappers.RSItem;
  52. import org.rsbot.script.wrappers.RSNPC;
  53. import org.rsbot.script.wrappers.RSPlayer;
  54. import org.rsbot.script.wrappers.RSTile;
  55. import org.rsbot.util.GlobalConfiguration;
  56.  
  57. @ScriptManifest(authors = { "Aaimister" }, name = "Aaimisters Chicken Killer", keywords = "Combat", version = 1.06, description = ("Kills chickens."))
  58. public class AaimistersChickenKiller extends Script implements MessageListener, PaintListener, MouseListener {
  59.  
  60.   private RSTile InPen;
  61.  
  62.   private RSArea Pen;
  63.   private RSArea ChickenPenF = new RSArea(new RSTile(3014, 3282), new RSTile(
  64.       3020, 3297));
  65.   private RSArea ChickenPenLum = new RSArea(new RSTile(3225, 3295),
  66.       new RSTile(3236, 3301));
  67.   private RSArea ChickenPenFout = new RSArea(new RSTile(3026, 3282), new RSTile(3037, 3291));
  68.   private RSArea Champion = new RSArea(new RSTile(3195, 3351), new RSTile(3199, 3360));
  69.  
  70.   private final String[] locationstring = { "Falador Pen", "Falador Porch", "Lumbridge Pen", "Champion's Guild" };
  71.   private final String[] statstring = { "Attack", "Strength", "Defence", "Range" };
  72.   private final String[] colorstring = { "Black", "Blue", "Cyan", "Green", "Lime", "Orange", "Pink", "Purple", "Red", "White", "Yellow" };
  73.  
  74.   private long nextBreak = System.currentTimeMillis();
  75.   private long nextLength = 60000;
  76.   private long startTime;
  77.  
  78.   final ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class);
  79.   AaimistersGUI g = new AaimistersGUI();
  80.   public final File settingsFile = new File(new File(GlobalConfiguration.Paths.getSettingsDirectory()),
  81.       "AaimistersCKillerSettings.txt");
  82.  
  83.   Font Kat = new Font("KaiTi", Font.BOLD, 10);
  84.  
  85.   Color Black = new Color(0, 0, 0);
  86.   Color Black90 = new Color(0, 0, 0, 90);
  87.   Color Black150 = new Color(0, 0, 0, 150);
  88.   Color White = new Color(255, 255, 255);
  89.   Color MainColor;
  90.   Color ClickC = new Color(187, 0, 0);
  91.   Color PercentRed = new Color(163, 4, 0, 150);
  92.   Color PercentGreen = new Color(0, 163, 4, 150);
  93.   Color UpGreen = new Color(0, 169, 0);
  94.   Color UpRed = new Color(169, 0, 0);
  95.  
  96.   final NumberFormat nf = NumberFormat.getInstance();
  97.  
  98.   public boolean currentlyBreaking = false;
  99.   public boolean randomBreaks = false;
  100.   public boolean buttonStats = false;
  101.   public boolean waitForLoot = false;
  102.   public boolean lootFeather = false;
  103.   public boolean buttonMain = false;
  104.   public boolean buttonInfo = false;
  105.   public boolean buttonAll = false;
  106.   public boolean antiBanOn = false;
  107.   public boolean lootArrow = false;
  108.   public boolean useSetting = true;
  109.   public boolean showPaint = true;
  110.   public boolean painting = false;
  111.   public boolean doBreak = false;
  112.   public boolean checkAmmo;
  113.   public boolean outofAmmo;
  114.   private boolean updated;
  115.   private boolean done;
  116.   private boolean closed;
  117.  
  118.   private String currentChic = "Chic Lvl 1";
  119.   private String status = "";
  120.   private String location = "";
  121.   private String myName = "";
  122.  
  123.   int drop[] = { 526, 1925, 1944, 2138 };
  124.   int Chickens[] = { 1017, 41 };
  125.   int runEnergy = (random(40, 75));
  126.   int arrow = 882;
  127.   int feathers = 314;
  128.   int antiCount = 0;
  129.   int random;
  130.   int pickItem;
  131.   int stat;
  132.   int priceArrow;
  133.   int priceFeather;
  134.   int xpToLvl;
  135.   int xpHour;
  136.   int timeToLvl;
  137.   int gainedLvl;
  138.   int startXP;
  139.   int chicToLvl;
  140.   int chicHour;
  141.   int total;
  142.   int currentXP;
  143.   int totalChic;
  144.   int xpGained;
  145.   int xpChic;
  146.   int maxBetween;
  147.   int minBetween;
  148.   int maxLength;
  149.   int minLength;
  150.  
  151.   private enum State { BACKTOCHICK, ATTACK };
  152.  
  153.   private State getState() {
  154.     if (!atPen()) {
  155.       return State.BACKTOCHICK;
  156.     } else {
  157.       return State.ATTACK;
  158.     }
  159.   }
  160.  
  161.   public double getVersion() {
  162.     return 1.06;
  163.   }
  164.  
  165.   @Override
  166.   public boolean onStart() {
  167.     status = "Starting up...";
  168.  
  169.     URLConnection url = null;
  170.         BufferedReader in = null;
  171.         BufferedWriter out = null;
  172.  
  173.      //Check right away...
  174.         try{
  175.             //Open the version text file
  176.             url = new URL("http://aaimister.webs.com/scripts/AaimistersChickenVersion.txt").openConnection();
  177.             //Create an input stream for it
  178.             in = new BufferedReader(new InputStreamReader(url.getInputStream()));
  179.             //Check if the current version is outdated
  180.             if(Double.parseDouble(in.readLine()) > getVersion()) {
  181.                 if(JOptionPane.showConfirmDialog(null, "Update found. Do you want to update?") == 0){
  182.                   updated = false;
  183.                     //If so, allow the user to choose the file to be updated.
  184.                        JOptionPane.showMessageDialog(null, "Please choose 'AaimistersChickenKiller.java' in your scripts folder and hit 'Open'");
  185.                        JFileChooser fc = new JFileChooser();
  186.                        //Make sure "Open" was clicked.
  187.                        if(fc.showOpenDialog(null) == JFileChooser.APPROVE_OPTION){
  188.                            //If so, set up the URL for the .java file and set up the IO.
  189.                            url = new URL("http://aaimister.webs.com/scripts/AaimistersChickenKiller.java").openConnection();
  190.                         in = new BufferedReader(new InputStreamReader(url.getInputStream()));
  191.                         out = new BufferedWriter(new FileWriter(fc.getSelectedFile().getPath()));
  192.                         String inp;
  193.                         /* Until we reach the end of the file, write the next line in the file
  194.                          * and add a new line. Then flush the buffer to ensure we lose
  195.                          * no data in the process.
  196.                          */
  197.                         while((inp = in.readLine()) != null){
  198.                             out.write(inp);
  199.                             out.newLine();
  200.                             out.flush();
  201.                         }
  202.                         //Notify the user that the script has been updated, and a recompile and reload is needed.
  203.                            log("Script successfully downloaded. Please recompile and reload your scripts!");
  204.                         return false;
  205.                        } else {
  206.                          log("Update canceled");
  207.                        }
  208.                 } else {
  209.                   log("Update canceled");
  210.                 }
  211.             } else {
  212.               JOptionPane.showMessageDialog(null, "You have the latest version.");//User has the latest version. Tell them!
  213.                updated = true;
  214.                  if (in != null) {
  215.                    in.close();
  216.                  }
  217.             }
  218.         } catch (IOException e){
  219.             log("Problem getting version. Please visit the forums.");
  220.             updated = false;
  221.             return false; //Return false if there was a problem
  222.         }
  223.  
  224.         try {
  225.       settingsFile.createNewFile();
  226.     } catch (final IOException ignored) {
  227.     }
  228.  
  229.         g.AaimistersGUI.setVisible(true);
  230.         while (!done) {
  231.             if (closed) {
  232.                 log.severe("The GUI window was closed!");
  233.                 return false;
  234.             } else {
  235.               sleep(random(50, 100));
  236.             }
  237.         }
  238.  
  239.     priceArrow = getGuidePrice(arrow);
  240.     priceFeather = getGuidePrice(feathers);
  241.     startTime = System.currentTimeMillis();
  242.     startXP = skills.getCurrentExp(stat);
  243.     currentXP = skills.getExpToNextLevel(stat);
  244.  
  245.         if (lootArrow) {
  246.           log("Price of Arrows: " + priceArrow);
  247.         }
  248.  
  249.         if (lootFeather) {
  250.           log("Price of feathers: " + priceFeather);
  251.         }
  252.         breakingNew();
  253.  
  254.     return true;
  255.   }
  256.  
  257.   public void onFinish() {
  258.     long runTime = System.currentTimeMillis() - startTime;
  259.     runTime = System.currentTimeMillis() - startTime;
  260.     final String formattedTime = formatTime((int) runTime);
  261.     log("Thanks for using Aaimister's Chicken Killer!");
  262.     log("In " + formattedTime + " You killed " + totalChic + " chickens, and gained " + gainedLvl + " Level(s)!");
  263.   }
  264.  
  265.   private void breakingNew(){
  266.     if (randomBreaks){
  267.       long varTime = random(3660000, 10800000);
  268.       nextBreak = System.currentTimeMillis() + varTime;
  269.       long varLength = random(900000, 3600000);
  270.       nextLength = varLength;
  271.     } else {
  272.       int diff = random(0, 5) * 1000 * 60;
  273.       long varTime = random((minBetween * 1000 * 60) + diff, (maxBetween * 1000 * 60) - diff);
  274.       nextBreak = System.currentTimeMillis() + varTime;
  275.       int diff2 = random(0, 5) * 1000 * 60;
  276.       long varLength = random((minLength * 1000 * 60) + diff2, (maxLength * 1000 * 60) - diff2);
  277.       nextLength = varLength;
  278.     }
  279.   }
  280.  
  281.   private boolean breakingCheck(){
  282.     if (nextBreak <= System.currentTimeMillis()){
  283.       return true;
  284.     }
  285.     return false;
  286.   }
  287.  
  288.   private boolean atPen() {
  289.     return Pen.contains(getMyPlayer().getLocation());
  290.   }
  291.  
  292.   private boolean idle() {
  293.     if (getMyPlayer().getAnimation() == -1) {
  294.       return true;
  295.     }
  296.     return false;
  297.   }
  298.  
  299.   public void dropAllExcept(boolean leftToRight, int... items) {
  300.     while (inventory.getCountExcept(items) != 0) {
  301.       if (!leftToRight) {
  302.         for (int c = 0; c < 4; c++) {
  303.           for (int r = 0; r < 7; r++) {
  304.             boolean found = false;
  305.             for (int i = 0; i < items.length && !found; ++i) {
  306.               found = items[i] == inventory.getItems()[c + r * 4]
  307.                   .getID();
  308.             }
  309.             if (!found) {
  310.               dropItem(c, r);
  311.             }
  312.           }
  313.         }
  314.       } else {
  315.         for (int r = 0; r < 7; r++) {
  316.           for (int c = 0; c < 4; c++) {
  317.             boolean found = false;
  318.             for (int i = 0; i < items.length && !found; ++i) {
  319.               found = items[i] == inventory.getItems()[c + r * 4]
  320.                   .getID();
  321.             }
  322.             if (!found) {
  323.               dropItem(c, r);
  324.             }
  325.           }
  326.         }
  327.       }
  328.       sleep(random(500, 800));
  329.     }
  330.   }
  331.  
  332.   public void dropItem(int col, int row) {
  333.     if (interfaces.get(210).getComponent(2).getText()
  334.         .equals("Click here to continue")) {
  335.       sleep(random(800, 1300));
  336.       if (interfaces.get(210).getComponent(2).getText()
  337.           .equals("Click here to continue")) {
  338.         interfaces.get(210).getComponent(2).doClick();
  339.         sleep(random(150, 200));
  340.       }
  341.     }
  342.     if (game.getCurrentTab() != 4
  343.         && !interfaces.get(762).isValid()
  344.         && !interfaces.get(620).isValid()) {
  345.       game.openTab(4);
  346.     }
  347.     if (col < 0 || col > 3 || row < 0 || row > 6)
  348.       return;
  349.     if (inventory.getItems()[col + row * 4].getID() == -1)
  350.       return;
  351.     Point p;
  352.     p = mouse.getLocation();
  353.     if (p.x < 563 + col * 42 || p.x >= 563 + col * 42 + 32
  354.         || p.y < 213 + row * 36 || p.y >= 213 + row * 36 + 32) {
  355.       mouse.hop(inventory.getInterface().getComponents()[row * 4 + col]
  356.           .getCenter(), 10, 10);
  357.     }
  358.     mouse.click(false);
  359.     sleep(100, 200);
  360.     menu.doAction("drop");
  361.     sleep(25, 50);
  362.   }
  363.  
  364.   private void setCamera() {
  365.     if (camera.getPitch() < 10) {
  366.       camera.setPitch(true);
  367.       sleep(1000, 1600);
  368.     }
  369.   }
  370.  
  371.   private void setRun() {
  372.     if (!walking.isRunEnabled()) {
  373.       if (walking.getEnergy() >= 50) {
  374.         walking.setRun(true);
  375.         sleep(1000, 1600);
  376.       }
  377.     }
  378.   }
  379.  
  380.   private RSGroundItem pickupFeather() {
  381.     return groundItems.getNearest(new Filter<RSGroundItem>() {
  382.       public boolean accept(RSGroundItem g) {
  383.         return g.getItem().getID() == feathers && Pen.contains(g.getLocation());
  384.       }
  385.     });
  386.   }
  387.  
  388.   private RSGroundItem pickupArrow() {
  389.     return groundItems.getNearest(new Filter<RSGroundItem>() {
  390.       public boolean accept(RSGroundItem g) {
  391.         return g.getItem().getID() == arrow && Pen.contains(g.getLocation());
  392.       }
  393.     });
  394.   }
  395.  
  396.   private RSNPC newNPC() {
  397.     RSNPC interacting = interactingNPC();
  398.     return interacting != null ? interacting : npcs.getNearest(new Filter<RSNPC>() {
  399.       public boolean accept(RSNPC npc) {
  400.         return npc.getName().equals("Chicken") && npc.getHPPercent() > 0 && !npc.isInCombat() && Pen.contains(npc.getLocation());
  401.       }
  402.     });
  403.   }
  404.  
  405.   private RSNPC interactingNPC() {
  406.     return npcs.getNearest(new Filter<RSNPC>() {
  407.       public boolean accept(RSNPC n) {
  408.         return n.getInteracting() != null && n.getInteracting().equals(players.getMyPlayer()) && Pen.contains(n.getLocation());
  409.       }
  410.     });
  411.   }
  412.  
  413.   private RSPlayer myPlayer() {
  414.     return players.getNearest(new Filter<RSPlayer>() {
  415.       public boolean accept(RSPlayer p) {
  416.         return p.getName() != myName && Pen.contains(p.getLocation());
  417.       }
  418.     });
  419.   }
  420.  
  421.   private RSPlayer playerNear() {
  422.     RSPlayer me = myPlayer();
  423.     return me != null ? me : players.getNearest(new Filter<RSPlayer>() {
  424.       public boolean accept(RSPlayer p) {
  425.         return Pen.contains(p.getLocation()) && !p.isMoving();
  426.       }
  427.     });
  428.   }
  429.  
  430.   @Override
  431.   public int loop() {
  432.     if (breakingCheck() && doBreak) {
  433.       status = "Breaking...";
  434.       long endTime = System.currentTimeMillis() + nextLength;
  435.       currentlyBreaking = true;
  436.       while (game.isLoggedIn()) {
  437.         game.logout(true);
  438.         sleep(50);
  439.       }
  440.       log("Taking a break for " + formatTime((int) nextLength));
  441.       while (System.currentTimeMillis() < endTime && currentlyBreaking == true){
  442.         sleep(1000);
  443.       }
  444.       currentlyBreaking = false;
  445.       while (!game.isLoggedIn()) {
  446.         try {
  447.           breakingNew();
  448.           game.login();
  449.         } catch (Exception e) {
  450.           return 10;
  451.         }
  452.         sleep(50);
  453.       }
  454.       return 10;
  455.     }
  456.  
  457.     if (!game.isLoggedIn()) {
  458.       return 3000;
  459.     }
  460.  
  461.     myName = players.getMyPlayer().getName();
  462.     setCamera();
  463.     setRun();
  464.     mouse.setSpeed(random(5, 12));
  465.  
  466.     switch (getState()) {
  467.     case ATTACK:
  468.       status = "Killing chickens...";
  469.       if (atPen()) {
  470.         antiCount = (random(0, 6));
  471.         if (checkAmmo) {
  472.           checkAmmo = false;
  473.           RSItem wield = inventory.getItem(arrow);
  474.           if (game.getCurrentTab() != 4) {
  475.             game.openTab(4);
  476.           } else {
  477.             if (inventory.contains(arrow)) {
  478.               wield.doAction("Wield");
  479.               return random(800, 1000);
  480.             } else {
  481.               outofAmmo = true;
  482.             }
  483.           }
  484.         }
  485.         if (players.getMyPlayer().getInteracting() != null) {
  486.           if (interfaces.canContinue()) {
  487.             interfaces.clickContinue();
  488.           }
  489.           return random(900, 1100);
  490.         }
  491.         if (idle() && (players.getMyPlayer().getInteracting() == null)) {
  492.           RSItem junk = inventory.getItem(drop);
  493.           if (junk != null) {
  494.             junk.doAction("Drop");
  495.             return random(800, 1000);
  496.           }
  497.           try {
  498.             if (lootFeather) {
  499.               RSGroundItem feathers = pickupFeather();
  500.               if (feathers != null) {
  501.                 if (players.getMyPlayer().isMoving()) {
  502.                   return random(400, 600);
  503.                 }
  504.                 if (!feathers.isOnScreen()) {
  505.                   RSTile featherT = walking.getClosestTileOnMap(feathers.getLocation()).randomize(-1, 1);
  506.                   if (Pen.contains(featherT)) {
  507.                     walking.walkTileMM(featherT);
  508.                   } else {
  509.                     return 100;
  510.                   }
  511.                   return random(900, 1200);
  512.                 }
  513.                 feathers.doAction("Take Feather");
  514.                 return random(900, 1100);
  515.               }
  516.             }
  517.           } catch (Exception e) {
  518.             log("Just a mis-click. =]");
  519.           }
  520.           try {
  521.             if (lootArrow) {
  522.               RSGroundItem arrow = pickupArrow();
  523.               if (arrow != null) {
  524.                 if (players.getMyPlayer().isMoving()) {
  525.                   return random(400, 600);
  526.                 }
  527.                 if (!arrow.isOnScreen()) {
  528.                   RSTile arrowT = walking.getClosestTileOnMap(arrow.getLocation()).randomize(-1, 1);
  529.                   if (Pen.contains(arrowT)) {
  530.                     walking.walkTileMM(arrowT);
  531.                   } else {
  532.                     return 100;
  533.                   }
  534.                   return random(900, 1200);
  535.                 }
  536.                 arrow.doAction("Take Bronze");
  537.                 return random(900, 1100);
  538.               }
  539.             }
  540.           } catch (Exception e) {
  541.             log("Just a mis-click. =]");
  542.           }
  543.           try {
  544.             RSNPC chic = newNPC();
  545.             if (chic != null) {
  546.               if (players.getMyPlayer().isMoving()) {
  547.                 return random(400, 600);
  548.               }
  549.               if (chic.isOnScreen()) {
  550.                 chic.doAction("Attack " + chic.getName());
  551.                 return random(1000, 1600);
  552.               } else if (!chic.isOnScreen()) {
  553.                 RSTile chicT = walking.getClosestTileOnMap(chic.getLocation()).randomize(-1, 1);
  554.                 if (Pen.contains(chicT)) {
  555.                   walking.walkTileMM(chicT);
  556.                 } else {
  557.                   return 100;
  558.                 }
  559.                 if (waitForLoot) {
  560.                   sleep(2800, 3500);
  561.                 }
  562.                 return random(1100, 1500);
  563.               }
  564.             }
  565.           } catch (Exception e) {
  566.             log("Just a mis-click. =]");
  567.           }
  568.           if (antiCount == (random(0, 6))) {
  569.             doAntiBan();
  570.             return random(1000, 1600);
  571.           }
  572.         }
  573.         if (antiCount == (random(0, 6))) {
  574.           doAntiBan();
  575.           return random(1000, 1600);
  576.         }
  577.       }
  578.       break;
  579.     case BACKTOCHICK:
  580.       status = "Finding pen...";
  581.       if (!atPen()) {
  582.         if (!idle() || getMyPlayer().isInCombat()) {
  583.           return random(1000, 1500);
  584.         }
  585.         if (idle() && !getMyPlayer().isInCombat()) {
  586.           RSTile Next = walking.getClosestTileOnMap(InPen).randomize(-2, 2);
  587.           walking.walkTileMM(Next);
  588.           sleep(1000, 1500);
  589.         } else {
  590.           return random(1000, 1600);
  591.         }
  592.       }
  593.       break;
  594.     }
  595.     return (random(650, 1050));
  596.   }
  597.  
  598.   //Credits Aion
  599.   private int getGuidePrice(int itemID) {
  600.         try {
  601.             URL url = new URL(
  602.                     "http://services.runescape.com/m=itemdb_rs/viewitem.ws?obj="
  603.                             + itemID);
  604.             BufferedReader br = new BufferedReader(new InputStreamReader(
  605.                     url.openStream()));
  606.             String line = null;
  607.  
  608.             while ((line = br.readLine()) != null) {
  609.                 if (line.contains("<b>Current guide price:</b>")) {
  610.                     line = line.replace("<b>Current guide price:</b>", "");
  611.                     return (int) parse(line);
  612.                 }
  613.             }
  614.         } catch (IOException e) {
  615.         }
  616.         return -1;
  617.     }
  618.  
  619.  
  620.   //Credits Aion
  621.     private double parse(String str) {
  622.         if (str != null && !str.isEmpty()) {
  623.             str = stripFormatting(str);
  624.             str = str.substring(str.indexOf(58) + 2, str.length());
  625.             str = str.replace(",", "");
  626.             if (!str.endsWith("%")) {
  627.                 if (!str.endsWith("k") && !str.endsWith("m")) {
  628.                     return Double.parseDouble(str);
  629.                 }
  630.                 return Double.parseDouble(str.substring(0, str.length() - 1))
  631.                         * (str.endsWith("m") ? 1000000 : 1000);
  632.             }
  633.             int k = str.startsWith("+") ? 1 : -1;
  634.             str = str.substring(1);
  635.             return Double.parseDouble(str.substring(0, str.length() - 1)) * k;
  636.         }
  637.         return -1D;
  638.     }
  639.  
  640.     public void doAntiBan() {
  641.  
  642.       if (antiBanOn == false) {
  643.             return;
  644.       }
  645.  
  646.       int action = random(0, 8);
  647.  
  648.       switch (action) {
  649.       case 0:
  650.         random = (random(1, 3));
  651.         if (random == random(0, 4)) {
  652.           rotateCamera();
  653.           sleep(200, 400);
  654.           antiCount = (random(0, 6));
  655.         } else {
  656.           return;
  657.         }
  658.         break;
  659.       case 1:
  660.         mouse.moveRandomly(100, 900);
  661.         sleep(200, 400);
  662.         antiCount = (random(0, 6));
  663.         break;
  664.       case 2:
  665.         random = (random(1, 3));
  666.         if (random == random(0, 4)) {
  667.           checkPlayer();
  668.           sleep(200, 400);
  669.           antiCount = (random(0, 6));
  670.         } else {
  671.           return;
  672.         }
  673.         break;
  674.       case 3:
  675.         random = (random(1, 6));
  676.         if (random == random(0, 7)) {
  677.           rotateCamera();
  678.           sleep(200, 400);
  679.           antiCount = (random(0, 6));
  680.         } else {
  681.           return;
  682.         }
  683.         break;
  684.       case 4:
  685.         mouse.moveRandomly(100, 900);
  686.         sleep(200, 400);
  687.         antiCount = (random(0, 6));
  688.         break;
  689.       case 5:
  690.         random = (random(1, 6));
  691.         if (random == random(0, 7)) {
  692.           checkEXP();
  693.           sleep(200, 400);
  694.           antiCount = (random(0, 6));
  695.         } else {
  696.           return;
  697.         }
  698.         break;
  699.       case 6:
  700.         mouse.moveRandomly(100, 900);
  701.         sleep(200, 400);
  702.         antiCount = (random(0, 6));
  703.         break;
  704.       case 7:
  705.         random = (random(1, 6));
  706.         if (random == random(0, 7)) {
  707.           randomTile();
  708.           sleep(200, 400);
  709.           antiCount = (random(0, 6));
  710.         } else {
  711.           return;
  712.         }
  713.       }
  714.     }
  715.  
  716.     public void randomTile() {
  717.       RSTile random = InPen.randomize(-5, 5);
  718.       if (Pen.contains(random)) {
  719.         if (idle()) {
  720.           walking.walkTileMM(walking.getClosestTileOnMap(random));
  721.           sleep(1200, 1500);
  722.         }
  723.       } else {
  724.         return;
  725.       }
  726.     }
  727.  
  728.     public void checkPlayer() {
  729.       RSPlayer near = playerNear();
  730.       if (near != null) {
  731.         if (!players.getMyPlayer().isMoving()) {
  732.           if (near.getScreenLocation() != null) {
  733.             if (mouse.getLocation() != near.getScreenLocation()) {
  734.                   mouse.move(near.getScreenLocation());
  735.                   sleep(300, 550);
  736.                 }
  737.             mouse.click(false);
  738.             sleep(300, 500);
  739.             if (menu.contains("Follow")) {
  740.               Point menuu = menu.getLocation();
  741.                 int Mx = menuu.y;
  742.                 int My = menuu.y;
  743.                 int x = Mx + random(3, 120);
  744.                 int y = My + random(3, 98);
  745.                 mouse.move(x, y);
  746.                     sleep(2320, 3520);
  747.                     mouse.moveRandomly(100, 900);
  748.                     if (menu.isOpen()) {
  749.                       mouse.moveRandomly(100, 900);
  750.                     }
  751.             } else {
  752.               mouse.moveRandomly(100, 900);
  753.             }
  754.           }
  755.         } else {
  756.           return;
  757.         }
  758.       }
  759.     }
  760.  
  761.     public void checkEXP() {
  762.       if (game.getCurrentTab() != 1) {
  763.         game.openTab(1);
  764.         sleep(500, 900);
  765.       }
  766.       if (stat == 0) {
  767.         mouse.move(random(551, 604), random(214, 233));
  768.         sleep(3000, 5500);
  769.         game.openTab(4);
  770.         sleep(50, 100);
  771.         mouse.moveRandomly(50, 900);
  772.       } else if (stat == 1) {
  773.         mouse.move(random(551, 604), random(269, 289));
  774.         sleep(3000, 5500);
  775.         game.openTab(4);
  776.         sleep(50, 100);
  777.         mouse.moveRandomly(50, 900);
  778.       } else if (stat == 2) {
  779.         mouse.move(random(551, 604), random(241, 261));
  780.         sleep(3000, 5500);
  781.         game.openTab(4);
  782.         sleep(50, 100);
  783.         mouse.moveRandomly(50, 900);
  784.       } else if (stat == 4) {
  785.         mouse.move(random(551, 604), random(298, 316));
  786.         sleep(3000, 5500);
  787.         game.openTab(4);
  788.         sleep(50, 100);
  789.         mouse.moveRandomly(50, 900);
  790.       }
  791.     }
  792.  
  793.     public void rotateCamera() {
  794.         final char[] LR = new char[] { KeyEvent.VK_LEFT,
  795.                 KeyEvent.VK_RIGHT };
  796.         final char[] DU = new char[] { KeyEvent.VK_DOWN,
  797.                 KeyEvent.VK_UP };
  798.  
  799.         int x = random(0, 2);
  800.         int key = 0;        
  801.  
  802.         keyboard.pressKey(LR[x]);
  803.         if (getMyPlayer().getAnimation() != -1) {
  804.             keyboard.pressKey(DU[1]);
  805.             key = 0;
  806.         }
  807.         sleep(500, 1000);
  808.         keyboard.releaseKey(DU[key]);
  809.         keyboard.releaseKey(LR[x]);
  810.     }
  811.  
  812.     private String stripFormatting(String str) {
  813.         if (str != null && !str.isEmpty())
  814.             return str.replaceAll("(^[^<]+>|<[^>]+>|<[^>]+$)", "");
  815.         return "";
  816.     }
  817.  
  818.   @Override
  819.   public void messageReceived(MessageEvent e) {
  820.     if (stat == 0) {
  821.       if (e.getMessage().contains("You've just advanced an Attack")) {
  822.         gainedLvl++;
  823.       }
  824.     } else if (stat == 1) {
  825.       if (e.getMessage().contains("You've just advanced a Defence")) {
  826.         gainedLvl++;
  827.       }
  828.     } else if (stat == 2) {
  829.       if (e.getMessage().contains("You've just advanced a Strength")) {
  830.         gainedLvl++;
  831.       }
  832.     } else if (stat == 4) {
  833.       if (e.getMessage().contains("You've just advanced a Ranged")) {
  834.         gainedLvl++;
  835.       }
  836.       if (e.getMessage().contains("There is no ammo")) {
  837.         checkAmmo = true;
  838.         if (outofAmmo) {
  839.           log("Out of ammo. =/");
  840.           stopScript();
  841.         }
  842.       }
  843.     }
  844.   }
  845.  
  846.   public void drawMouse(final Graphics g) {
  847.     final Point loc = mouse.getLocation();
  848.     final long mpt = System.currentTimeMillis() - mouse.getPressTime();
  849.     if (mouse.getPressTime() == -1 || mpt >= 1000) {
  850.       g.setColor(MainColor);
  851.       g.fillRect(loc.x - 1, loc.y - 1, 3, 3);
  852.       g.drawLine(0, loc.y, 766, loc.y);
  853.       g.drawLine(loc.x, 0, loc.x, 505);
  854.     }
  855.     if (mpt < 1000) {
  856.       g.setColor(ClickC);
  857.       g.fill3DRect(loc.x - 1, loc.y - 1, 3, 3, true);
  858.       g.drawLine(0, loc.y, 766, loc.y);
  859.       g.drawLine(loc.x, 0, loc.x, 505);
  860.     }
  861.   }
  862.  
  863.   public void mouseClicked(MouseEvent e){
  864.   }
  865.   public void mouseEntered(MouseEvent e){
  866.   }
  867.   public void mouseExited(MouseEvent e){
  868.   }
  869.   public void mousePressed(MouseEvent e){
  870.     if (e.getX() >= 220 && e.getX() < 220 + 75 && e.getY() >= 322 && e.getY() < 322 + 12) {
  871.       if (!buttonMain) {
  872.         buttonMain = true;
  873.       } else {
  874.         buttonMain = false;
  875.       }
  876.     }
  877.     if (e.getX() >= 300 && e.getX() < 300 + 75 && e.getY() >= 322 && e.getY() < 322 + 12) {
  878.       if (!buttonStats) {
  879.         buttonStats = true;
  880.       } else {
  881.         buttonStats = false;
  882.       }
  883.     }
  884.     if (e.getX() >= 380 && e.getX() < 380 + 75 && e.getY() >= 322 && e.getY() < 322 + 12) {
  885.       if (!buttonInfo) {
  886.         buttonInfo = true;
  887.       } else {
  888.         buttonInfo = false;
  889.       }
  890.     }
  891.     if (e.getX() >= 460 && e.getX() < 460 + 50 && e.getY() >= 322 && e.getY() < 322 + 12) {
  892.       if (!buttonAll) {
  893.         buttonAll = true;
  894.       } else {
  895.         buttonAll = false;
  896.       }
  897.     }
  898.   }
  899.   public void mouseReleased(MouseEvent e){
  900.   }
  901.  
  902.   String formatTime(final int milliseconds) {
  903.     final long t_seconds = milliseconds / 1000;
  904.     final long t_minutes = t_seconds / 60;
  905.     final long t_hours = t_minutes / 60;
  906.     final int seconds = (int) (t_seconds % 60);
  907.     final int minutes = (int) (t_minutes % 60);
  908.     final int hours = (int) (t_hours % 60);
  909.     return (nf.format(hours) + ":" + nf.format(minutes) + ":" + nf.format(seconds));
  910.   }
  911.  
  912.   public void onRepaint(Graphics g) {
  913.     long runTime = System.currentTimeMillis() - startTime;
  914.     runTime = System.currentTimeMillis() - startTime;
  915.     final String formattedTime = formatTime((int) runTime);
  916.  
  917.     currentXP = skills.getExpToNextLevel(stat);
  918.     NumberFormat formatter = new DecimalFormat("#,###,###");
  919.  
  920.     xpChic = (int) (30 * 0.4);
  921.     xpToLvl = skills.getExpToNextLevel(stat);
  922.     xpGained = skills.getCurrentExp(stat) - startXP;
  923.     xpHour = ((int) ((3600000.0 / (double) runTime) * xpGained));
  924.     timeToLvl = (int) (((double) xpToLvl / (double) xpHour) * 3600000.0);
  925.     totalChic = (int) (xpGained / (double) xpChic);
  926.     total = (xpChic * totalChic);
  927.     chicHour = (int) ((3600000.0 / (double) runTime) * totalChic);
  928.     chicToLvl = (int) (currentXP / (double) xpChic);
  929.  
  930.     if (painting) {
  931.       ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  932.       ((Graphics2D)g).setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
  933.       ((Graphics2D)g).setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
  934.     }
  935.  
  936.     // main bar
  937.     g.setColor(MainColor);
  938.     g.fillRoundRect(4, 318, 512, 20, 5, 10);
  939.     g.setColor(Black);
  940.     g.drawRoundRect(4, 318, 512, 20, 5, 10);
  941.  
  942.     // % bar
  943.     g.setColor(Black);
  944.     g.fillRoundRect(10, 322, 200, 12, 5, 10);
  945.     g.setColor(PercentRed);
  946.     g.fillRoundRect(10, 322, 200, 12, 5, 10);
  947.     g.setColor(PercentGreen);
  948.     g.fillRoundRect(10, 322, skills.getPercentToNextLevel(stat) * 2, 12, 5, 10);
  949.     g.setColor(Black);
  950.     g.drawRoundRect(10, 322, 200, 12, 5, 10);
  951.     g.setFont(new Font("KaiTi", Font.BOLD, 10));
  952.     g.setColor(White);
  953.     g.drawString("" + skills.getPercentToNextLevel(stat) + "%", 101, 332);
  954.  
  955.     // Button Main
  956.     g.setColor(Black150);
  957.     g.fillRoundRect(220, 322, 75, 12, 5, 10);
  958.     g.setColor(Black);
  959.     g.drawRoundRect(220, 322, 75, 12, 5, 10);
  960.     g.setFont(Kat);
  961.     g.setColor(White);
  962.     g.drawString("Main", 248, 332);
  963.     if (buttonMain) {
  964.       g.setColor(Black150);
  965.       g.fillRoundRect(220, 322, 75, 12, 5, 10);
  966.       g.drawString("Main", 248, 332);
  967.       // Box
  968.       g.setColor(Black150);
  969.       g.fillRoundRect(95, 246, 200, 72, 5, 10);
  970.       g.setColor(Black);
  971.       g.drawRoundRect(95, 246, 200, 72, 5, 10);
  972.       g.setColor(White);
  973.       g.setFont(Kat);
  974.       g.drawString("Chic(s) Killed: " + formatter.format((long)(totalChic)), 100, 263);
  975.       g.drawString("Chic(s) / Hour: " + formatter.format((long)(chicHour)), 100, 278);
  976.       g.drawString("Chic Killing: " + currentChic, 100, 295);
  977.       g.drawString("Chic(s) to Lvl: " + formatter.format((long)(chicToLvl)), 100, 310);
  978.     }
  979.  
  980.     // Button Stats
  981.     g.setColor(Black150);
  982.     g.fillRoundRect(300, 322, 75, 12, 5, 10);
  983.     g.setColor(Black);
  984.     g.drawRoundRect(300, 322, 75, 12, 5, 10);
  985.     g.setFont(Kat);
  986.     g.setColor(White);
  987.     g.drawString("Stats", 327, 332);
  988.     if (buttonStats) {
  989.       g.setColor(Black150);
  990.       g.fillRoundRect(300, 322, 75, 12, 5, 10);
  991.       g.drawString("Stats", 327, 332);
  992.       // Box
  993.       g.setColor(Black150);
  994.       g.fillRoundRect(175, 216, 200, 102, 5, 10);
  995.       g.setColor(Black);
  996.       g.drawRoundRect(175, 216, 200, 102, 5, 10);
  997.       g.setColor(White);
  998.       g.setFont(Kat);
  999.       g.drawString("Total XP: " + formatter.format((long)(total)), 180, 233);
  1000.       g.drawString("XP / Hour: " + formatter.format((long)(xpHour)), 180, 248);
  1001.       g.drawString("XP to Lvl: " + formatter.format((long)(currentXP)), 180, 263);
  1002.       g.drawString("Lvl in: " + formatTime(timeToLvl), 180, 278);
  1003.       g.drawString("Current Lvl: " + (skills.getCurrentLevel(stat)), 180,
  1004.           295);
  1005.       g.drawString("Gained Lvl(s): " + gainedLvl, 180, 310);
  1006.     }
  1007.  
  1008.     // Button Info
  1009.     g.setColor(Black150);
  1010.     g.fillRoundRect(380, 322, 75, 12, 5, 10);
  1011.     g.setColor(Black);
  1012.     g.drawRoundRect(380, 322, 75, 12, 5, 10);
  1013.     g.setFont(Kat);
  1014.     g.setColor(White);
  1015.     g.drawString("Info", 408, 332);
  1016.     if (buttonInfo) {
  1017.       g.setColor(Black150);
  1018.       g.fillRoundRect(380, 322, 75, 12, 5, 10);
  1019.       g.drawString("Info", 408, 332);
  1020.       // Box
  1021.       g.setColor(Black150);
  1022.       g.fillRoundRect(255, 231, 200, 87, 5, 10);
  1023.       g.setColor(Black);
  1024.       g.drawRoundRect(255, 231, 200, 87, 5, 10);
  1025.       g.setColor(White);
  1026.       g.setFont(Kat);
  1027.       g.drawString("Time running: " + formattedTime, 260, 248);
  1028.       g.drawString("Location: " + location, 260, 263);
  1029.       g.drawString("Status: " + status, 260, 278);
  1030.       g.drawString("Version: " + 1.06, 260, 295);
  1031.       if (updated) {
  1032.         g.setColor(UpGreen);
  1033.         g.drawString("By: Aaimister", 260, 312);
  1034.       } else {
  1035.         g.setColor(UpRed);
  1036.         g.drawString("By: Aaimister", 260, 312);
  1037.       }
  1038.     }
  1039.  
  1040.     // ALL
  1041.     g.setColor(Black150);
  1042.     g.fillRoundRect(460, 322, 50, 12, 5, 10);
  1043.     g.setColor(Black);
  1044.     g.drawRoundRect(460, 322, 50, 12, 5, 10);
  1045.     g.setFont(Kat);
  1046.     g.setColor(White);
  1047.     g.drawString("All", 477, 332);
  1048.     if (buttonAll) {
  1049.       g.setColor(Black150);
  1050.       g.fillRoundRect(460, 322, 50, 12, 5, 10);
  1051.       g.drawString("All", 477, 332);
  1052.       // Box
  1053.       g.setColor(Black150);
  1054.       g.fillRoundRect(310, 81, 200, 237, 5, 10);
  1055.       g.setColor(Black);
  1056.       g.drawRoundRect(310, 81, 200, 237, 5, 10);
  1057.       g.setColor(White);
  1058.       g.setFont(Kat);
  1059.       g.drawString("Chic(s) Killed: " + formatter.format((long)(totalChic)), 315, 98);
  1060.       g.drawString("Chic(s) / Hour: " + formatter.format((long)(chicHour)), 315, 113);
  1061.       g.drawString("Chic Killing: " + currentChic, 315, 128);
  1062.       g.drawString("Chic(s) to Lvl: " + formatter.format((long)(chicToLvl)), 315, 143);
  1063.       g.drawString("Total XP: " + formatter.format((long)(total)), 315, 158);
  1064.       g.drawString("XP / Hour: " + formatter.format((long)(xpHour)), 315, 173);
  1065.       g.drawString("XP to Lvl: " + formatter.format((long)(currentXP)), 315, 188);
  1066.       g.drawString("Lvl in: " + formatTime(timeToLvl), 315, 203);
  1067.       g.drawString("Current Lvl: " + (skills.getCurrentLevel(stat)), 315,
  1068.           218);
  1069.       g.drawString("Gained Lvl(s): " + gainedLvl, 315, 233);
  1070.       g.drawString("Time running: " + formattedTime, 315, 248);
  1071.       g.drawString("Location: " + location, 315, 263);
  1072.       g.drawString("Status: " + status, 315, 278);
  1073.       g.drawString("Version: " + 1.06, 315, 295);
  1074.       if (updated) {
  1075.         g.setColor(UpGreen);
  1076.         g.drawString("By: Aaimister", 315, 310);
  1077.       } else {
  1078.         g.setColor(UpRed);
  1079.         g.drawString("By: Aaimister", 315, 310);
  1080.       }
  1081.     }
  1082.  
  1083.     //Shadow
  1084.     g.setColor(Black90);
  1085.     g.fillRoundRect(4, 329, 512, 9, 5, 10);
  1086.  
  1087.     //Mouse
  1088.     drawMouse(g);
  1089.   }
  1090.  
  1091.   public class AaimistersGUI {
  1092.  
  1093.     private static final long serialVersionUID = 1L;
  1094.  
  1095.     private AaimistersGUI() {
  1096.       initComponents();
  1097.     }
  1098.  
  1099.     private void submitActionPerformed(ActionEvent e) {
  1100.       String color = colorBox.getSelectedItem().toString();
  1101.           if (color.contains("Blue")) {
  1102.             MainColor = new Color(0, 0, 187, 190);
  1103.           } else if (color.contains("Black")) {
  1104.             MainColor = new Color(0, 0, 0, 190);
  1105.           } else if (color.contains("Cyan")) {
  1106.             MainColor = new Color(0, 187, 187, 190);
  1107.           } else if (color.contains("Green")) {
  1108.             MainColor = new Color(0, 187, 0, 190);
  1109.           } else if (color.contains("Lime")) {
  1110.             MainColor = new Color(0, 255, 0, 190);
  1111.           } else if (color.contains("Orange")) {
  1112.             MainColor = new Color(255, 120, 0, 190);
  1113.           } else if (color.contains("Pink")) {
  1114.             MainColor = new Color(255, 0, 120, 190);
  1115.           } else if (color.contains("Purple")) {
  1116.             MainColor = new Color(120, 0, 255, 190);
  1117.           } else if (color.contains("Red")) {
  1118.             MainColor = new Color(187, 0, 0, 190);
  1119.             ClickC = Black;
  1120.           } else if (color.contains("White")) {
  1121.             MainColor = new Color(255, 255, 255, 190);
  1122.           } else if (color.contains("Yellow")) {
  1123.             MainColor = new Color(255, 255, 0, 190);
  1124.           }
  1125.           String chosen = locationBox.getSelectedItem().toString();
  1126.             if (chosen.contains("Falador Pen")) {
  1127.               InPen = new RSTile(3017, 3290);
  1128.           Pen = ChickenPenF;
  1129.           location = "Falador Pen";
  1130.             } else if (chosen.contains("Falador Porch")) {
  1131.               InPen = new RSTile(3032, 3286);
  1132.           Pen = ChickenPenFout;
  1133.           location = "Falador Porch";
  1134.             } else if (chosen.contains("Lumbridge Pen")) {
  1135.               InPen = new RSTile(3231, 3297);
  1136.               Pen = ChickenPenLum;
  1137.               location = "NorthWest Lum.";
  1138.             } else if (chosen.contains("Champion's Guild")) {
  1139.               InPen = new RSTile(3197, 3355);
  1140.           Pen = Champion;
  1141.           location = "Champion's Guild";
  1142.             }
  1143.             String stats = statBox.getSelectedItem().toString();
  1144.             if (stats.contains("Attack")) {
  1145.               stat = 0;
  1146.             } else if (stats.contains("Strength")) {
  1147.               stat = 2;
  1148.             } else if (stats.contains("Defence")) {
  1149.                 stat = 1;
  1150.             } else if (stats.contains("Range")) {
  1151.               stat = 4;
  1152.             }
  1153.             if (waitBox.isSelected()) {
  1154.               waitForLoot = true;
  1155.             }
  1156.             if (arrowBox.isSelected()) {
  1157.               lootArrow = true;
  1158.             }
  1159.             if (featherBox.isSelected()) {
  1160.               lootFeather = true;
  1161.             }
  1162.             if (paintBox.isSelected()) {
  1163.               painting = true;
  1164.             }
  1165.             if (antibanBox.isSelected()) {
  1166.               antiBanOn = true;
  1167.             }
  1168.             if (settingBox.isSelected()) {
  1169.               useSetting = true;
  1170.             }
  1171.             if (breakBox.isSelected()) {
  1172.               doBreak = true;
  1173.               if (randomBox.isSelected()) {
  1174.                 randomBreaks = true;
  1175.               }
  1176.               maxBetween = Integer.parseInt(maxTimeBeBox.getText());
  1177.               minBetween = Integer.parseInt(minTimeBeBox.getText());
  1178.               maxLength = Integer.parseInt(maxBreakBox.getText());
  1179.               minLength = Integer.parseInt(minBreakBox.getText());
  1180.               if (minBetween < 1) {
  1181.                 minBetween = 1;
  1182.               }
  1183.               if (minLength < 1) {
  1184.                 minLength = 1;
  1185.               }
  1186.               if (maxBetween > 5000) {
  1187.                 maxBetween = 5000;
  1188.               } else if (maxBetween < 6) {
  1189.                 maxBetween = 6;
  1190.               }
  1191.               if (maxLength > 5000) {
  1192.                 maxLength = 5000;
  1193.               } else if (maxLength < 5) {
  1194.                 maxLength = 5;
  1195.               }
  1196.             }
  1197.  
  1198.             // Write settings
  1199.       try {
  1200.         final BufferedWriter out = new BufferedWriter(new FileWriter(settingsFile));
  1201.         out.write((settingBox.isSelected() ? true : false)
  1202.             + ":" // 0
  1203.             + (locationBox.getSelectedIndex())
  1204.             + ":" // 1
  1205.             + (statBox.getSelectedIndex())
  1206.             + ":" // 2
  1207.             + (colorBox.getSelectedIndex())
  1208.             + ":" // 3
  1209.             + (antibanBox.isSelected() ? true : false)
  1210.             + ":" // 4
  1211.             + (waitBox.isSelected() ? true : false)
  1212.             + ":" // 5
  1213.             + (featherBox.isSelected() ? true : false)
  1214.             + ":" // 6
  1215.             + (arrowBox.isSelected() ? true : false)
  1216.             + ":" // 7
  1217.             + (paintBox.isSelected() ? true : false)
  1218.             + ":" // 8
  1219.             + (breakBox.isSelected() ? true : false)
  1220.             + ":" // 9
  1221.             + (randomBox.isSelected() ? true : false)
  1222.             + ":" // 10
  1223.             + (maxTimeBeBox.getText())
  1224.             + ":" // 11
  1225.             + (minTimeBeBox.getText())
  1226.             + ":" // 12
  1227.             + (maxBreakBox.getText())
  1228.             + ":" // 13
  1229.             + (minBreakBox.getText()));// 14
  1230.         out.close();
  1231.       } catch (final Exception e1) {
  1232.         log.warning("Error saving setting.");
  1233.       }
  1234.       // End write settings
  1235.  
  1236.             done = true;
  1237.             AaimistersGUI.dispose();
  1238.         }
  1239.  
  1240.     private void breakBoxActionPerformed(ActionEvent e) {
  1241.        doBreak = breakBox.isSelected();
  1242.        randomBreaks = randomBox.isSelected();
  1243.        if (!doBreak) {
  1244.          randomBox.setEnabled(false);
  1245.          randomBox.setSelected(false);
  1246.          maxTimeBeBox.setEnabled(false);
  1247.          minTimeBeBox.setEnabled(false);
  1248.          maxBreakBox.setEnabled(false);
  1249.          minBreakBox.setEnabled(false);
  1250.        } else {
  1251.          randomBox.setEnabled(true);
  1252.          if (!randomBreaks) {
  1253.            maxTimeBeBox.setEnabled(true);
  1254.             minTimeBeBox.setEnabled(true);
  1255.             maxBreakBox.setEnabled(true);
  1256.             minBreakBox.setEnabled(true);
  1257.          }
  1258.        }
  1259.      }
  1260.  
  1261.      private void randomBoxActionPerformed(ActionEvent e) {
  1262.        randomBreaks = randomBox.isSelected();
  1263.        if (randomBreaks == true) {
  1264.          maxTimeBeBox.setEnabled(false);
  1265.          minTimeBeBox.setEnabled(false);
  1266.          maxBreakBox.setEnabled(false);
  1267.          minBreakBox.setEnabled(false);
  1268.        } else {
  1269.          if (doBreak) {
  1270.            maxTimeBeBox.setEnabled(true);
  1271.             minTimeBeBox.setEnabled(true);
  1272.             maxBreakBox.setEnabled(true);
  1273.             minBreakBox.setEnabled(true);
  1274.          }
  1275.        }
  1276.      }
  1277.  
  1278.     private void initComponents() {
  1279.       AaimistersGUI = new JFrame();
  1280.       contentPane = new JPanel();
  1281.       settingBox = new JCheckBox();
  1282.       locationBox = new JComboBox();
  1283.       statBox = new JComboBox();
  1284.       colorBox = new JComboBox();
  1285.       antibanBox = new JCheckBox();
  1286.       waitBox = new JCheckBox();
  1287.       featherBox = new JCheckBox();
  1288.       arrowBox = new JCheckBox();
  1289.       paintBox = new JCheckBox();
  1290.       breakBox = new JCheckBox();
  1291.       randomBox = new JCheckBox();
  1292.       maxTimeBeBox = new JTextArea();
  1293.       minTimeBeBox = new JTextArea();
  1294.       maxBreakBox = new JTextArea();
  1295.       minBreakBox = new JTextArea();
  1296.       panel = new JPanel();
  1297.       panel_1 = new JPanel();
  1298.       panel_2 = new JPanel();
  1299.       panel_4 = new JPanel();
  1300.       lblAaimistersEssenceMiner = new JLabel();
  1301.       lblStatUsing = new JLabel();
  1302.       lblLocation = new JLabel();
  1303.       lblPaintColor = new JLabel();
  1304.       lblTimeBetweenBreaks = new JLabel();
  1305.       lblBreakLengths = new JLabel();
  1306.       lblTo = new JLabel();
  1307.       lblMins = new JLabel();
  1308.       label_3 = new JLabel();
  1309.       label_4 = new JLabel();
  1310.       label_5 = new JLabel();
  1311.       label_6 = new JLabel();
  1312.       tabbedPane = new JTabbedPane(JTabbedPane.TOP);
  1313.       submit = new JButton();
  1314.  
  1315.       // Listeners
  1316.           AaimistersGUI.addWindowListener(new WindowAdapter() {
  1317.               public void windowClosing(WindowEvent e) {
  1318.                   closed = true;
  1319.               }
  1320.           });
  1321.  
  1322.       AaimistersGUI.setTitle("Aaimister's Chicken Killer v1.06");
  1323.       AaimistersGUI.setForeground(new Color(255, 255, 255));
  1324.       AaimistersGUI.setBackground(Color.LIGHT_GRAY);
  1325.       AaimistersGUI.setResizable(false);
  1326.       AaimistersGUI.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  1327.       AaimistersGUI.setBounds(100, 100, 300, 400);
  1328.       AaimistersGUI.setContentPane(contentPane);
  1329.       contentPane.setBackground(SystemColor.menu);
  1330.       contentPane.setForeground(Color.LIGHT_GRAY);
  1331.       contentPane.setFont(new Font("Cambria Math", Font.PLAIN, 17));
  1332.       contentPane.setBorder(new EmptyBorder(5, 8, 8, 8));
  1333.       contentPane.setLayout(null);
  1334.  
  1335.       panel.setBorder(new MatteBorder(0, 0, 1, 0, (Color) new Color(0, 0, 0)));
  1336.       panel.setBounds(4, 0, 296, 40);
  1337.       contentPane.add(panel);
  1338.       panel.setLayout(null);
  1339.  
  1340.       lblAaimistersEssenceMiner.setText("Aaimister's Chicken Killer v1.06");
  1341.       lblAaimistersEssenceMiner.setBounds(0, 0, 296, 40);
  1342.       panel.add(lblAaimistersEssenceMiner);
  1343.       lblAaimistersEssenceMiner.setHorizontalAlignment(SwingConstants.CENTER);
  1344.       lblAaimistersEssenceMiner.setForeground(SystemColor.infoText);
  1345.       lblAaimistersEssenceMiner.setFont(new Font("Calibri", Font.BOLD, 20));
  1346.  
  1347.       tabbedPane.setBounds(4, 51, 286, 282);
  1348.       contentPane.add(tabbedPane);
  1349.  
  1350.       tabbedPane.addTab("General", null, panel_1, null);
  1351.  
  1352.       waitBox.setText("Wait For Loot");
  1353.       waitBox.setForeground(Color.BLACK);
  1354.       waitBox.setFont(new Font("Cambria Math", Font.PLAIN, 12));
  1355.  
  1356.       arrowBox.setText("Loot Arrows");
  1357.       arrowBox.setForeground(Color.BLACK);
  1358.       arrowBox.setFont(new Font("Cambria Math", Font.PLAIN, 12));
  1359.  
  1360.       featherBox.setText("Loot Feathers");
  1361.       featherBox.setForeground(Color.BLACK);
  1362.       featherBox.setFont(new Font("Cambria Math", Font.PLAIN, 12));
  1363.       featherBox.setSelected(true);
  1364.  
  1365.       paintBox.setText("Enable Anti-Aliasing");
  1366.       paintBox.setForeground(Color.BLACK);
  1367.       paintBox.setFont(new Font("Cambria Math", Font.PLAIN, 12));
  1368.       paintBox.setSelected(true);
  1369.  
  1370.       lblStatUsing.setText("Stat Using:");
  1371.       lblStatUsing.setForeground(Color.BLACK);
  1372.       lblStatUsing.setFont(new Font("Cambria Math", Font.PLAIN, 15));
  1373.  
  1374.       lblLocation.setText("Location:");
  1375.       lblLocation.setForeground(Color.BLACK);
  1376.       lblLocation.setFont(new Font("Cambria Math", Font.PLAIN, 15));
  1377.  
  1378.       lblPaintColor.setText("Paint Color:");
  1379.       lblPaintColor.setForeground(Color.BLACK);
  1380.       lblPaintColor.setFont(new Font("Cambria Math", Font.PLAIN, 15));
  1381.  
  1382.       statBox.setModel(new DefaultComboBoxModel(statstring));
  1383.  
  1384.       locationBox.setModel(new DefaultComboBoxModel(locationstring));
  1385.  
  1386.       colorBox.setModel(new DefaultComboBoxModel(colorstring));
  1387.  
  1388.       antibanBox.setText("Use Anti-Ban");
  1389.       antibanBox.setSelected(true);
  1390.       antibanBox.setForeground(Color.BLACK);
  1391.       antibanBox.setFont(new Font("Cambria Math", Font.PLAIN, 12));
  1392.  
  1393.       settingBox.setText("Save Settings");
  1394.       settingBox.setSelected(true);
  1395.       settingBox.setForeground(Color.BLACK);
  1396.       settingBox.setFont(new Font("Cambria Math", Font.PLAIN, 12));
  1397.       GroupLayout gl_panel_1 = new GroupLayout(panel_1);
  1398.       gl_panel_1.setHorizontalGroup(
  1399.         gl_panel_1.createParallelGroup(Alignment.LEADING)
  1400.           .addGroup(gl_panel_1.createSequentialGroup()
  1401.             .addGap(28)
  1402.             .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING)
  1403.               .addGroup(gl_panel_1.createSequentialGroup()
  1404.                 .addComponent(antibanBox, GroupLayout.PREFERRED_SIZE, 107, GroupLayout.PREFERRED_SIZE)
  1405.                 .addPreferredGap(ComponentPlacement.UNRELATED)
  1406.                 .addComponent(settingBox, GroupLayout.PREFERRED_SIZE, 107, GroupLayout.PREFERRED_SIZE))
  1407.               .addGroup(gl_panel_1.createSequentialGroup()
  1408.                 .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING)
  1409.                   .addComponent(lblStatUsing, GroupLayout.PREFERRED_SIZE, 79, GroupLayout.PREFERRED_SIZE)
  1410.                   .addComponent(lblPaintColor, GroupLayout.PREFERRED_SIZE, 79, GroupLayout.PREFERRED_SIZE)
  1411.                   .addComponent(lblLocation, GroupLayout.PREFERRED_SIZE, 79, GroupLayout.PREFERRED_SIZE))
  1412.                 .addPreferredGap(ComponentPlacement.UNRELATED)
  1413.                 .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING)
  1414.                   .addComponent(locationBox, GroupLayout.PREFERRED_SIZE, 102, GroupLayout.PREFERRED_SIZE)
  1415.                   .addComponent(colorBox, GroupLayout.PREFERRED_SIZE, 102, GroupLayout.PREFERRED_SIZE)
  1416.                   .addComponent(statBox, GroupLayout.PREFERRED_SIZE, 102, GroupLayout.PREFERRED_SIZE)))
  1417.               .addGroup(gl_panel_1.createSequentialGroup()
  1418.                 .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING)
  1419.                   .addComponent(featherBox, GroupLayout.PREFERRED_SIZE, 107, GroupLayout.PREFERRED_SIZE)
  1420.                   .addComponent(waitBox))
  1421.                 .addPreferredGap(ComponentPlacement.UNRELATED)
  1422.                 .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING)
  1423.                   .addComponent(arrowBox, GroupLayout.PREFERRED_SIZE, 103, GroupLayout.PREFERRED_SIZE)
  1424.                   .addComponent(paintBox, GroupLayout.DEFAULT_SIZE, 134, Short.MAX_VALUE))))
  1425.             .addContainerGap())
  1426.       );
  1427.       gl_panel_1.setVerticalGroup(
  1428.         gl_panel_1.createParallelGroup(Alignment.LEADING)
  1429.           .addGroup(gl_panel_1.createSequentialGroup()
  1430.             .addGap(17)
  1431.             .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
  1432.               .addComponent(waitBox)
  1433.               .addComponent(arrowBox))
  1434.             .addGap(18)
  1435.             .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
  1436.               .addComponent(featherBox)
  1437.               .addComponent(paintBox))
  1438.             .addGap(18)
  1439.             .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
  1440.               .addComponent(antibanBox)
  1441.               .addComponent(settingBox))
  1442.             .addGap(22)
  1443.             .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
  1444.               .addComponent(lblStatUsing)
  1445.               .addComponent(statBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
  1446.             .addGap(18)
  1447.             .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
  1448.               .addComponent(lblLocation)
  1449.               .addComponent(locationBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
  1450.             .addGap(18)
  1451.             .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
  1452.               .addComponent(lblPaintColor)
  1453.               .addComponent(colorBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
  1454.             .addContainerGap())
  1455.       );
  1456.       panel_1.setLayout(gl_panel_1);
  1457.  
  1458.       tabbedPane.addTab("Breaks", null, panel_2, null);
  1459.  
  1460.       breakBox.setText("Use Custom Breaks");
  1461.       breakBox.setForeground(Color.BLACK);
  1462.       breakBox.setFont(new Font("Cambria Math", Font.PLAIN, 12));
  1463.       breakBox.addActionListener(new ActionListener() {
  1464.         @Override
  1465.         public void actionPerformed(ActionEvent e) {
  1466.           breakBoxActionPerformed(e);
  1467.         }
  1468.       });
  1469.  
  1470.       lblTimeBetweenBreaks.setText("Time Between Breaks:");
  1471.       lblTimeBetweenBreaks.setForeground(Color.BLACK);
  1472.       lblTimeBetweenBreaks.setFont(new Font("Cambria Math", Font.PLAIN, 13));
  1473.  
  1474.       lblBreakLengths.setText("Break Lengths:");
  1475.       lblBreakLengths.setForeground(Color.BLACK);
  1476.       lblBreakLengths.setFont(new Font("Cambria Math", Font.PLAIN, 13));
  1477.  
  1478.       randomBox.setText("Random Breaks");
  1479.       randomBox.setForeground(Color.BLACK);
  1480.       randomBox.setFont(new Font("Cambria Math", Font.PLAIN, 12));
  1481.       randomBox.setEnabled(false);
  1482.       randomBox.addActionListener(new ActionListener() {
  1483.         @Override
  1484.         public void actionPerformed(ActionEvent e) {
  1485.           randomBoxActionPerformed(e);
  1486.         }
  1487.       });
  1488.  
  1489.       minTimeBeBox.setForeground(Color.BLACK);
  1490.       minTimeBeBox.setText("60");
  1491.       minTimeBeBox.setFont(new Font("Cambria Math", Font.PLAIN, 13));
  1492.       minTimeBeBox.setEnabled(false);
  1493.  
  1494.       lblTo.setText("to");
  1495.       lblTo.setForeground(Color.GRAY);
  1496.       lblTo.setFont(new Font("Cambria Math", Font.PLAIN, 13));
  1497.  
  1498.       maxTimeBeBox.setText("90");
  1499.       maxTimeBeBox.setForeground(Color.BLACK);
  1500.       maxTimeBeBox.setFont(new Font("Cambria Math", Font.PLAIN, 13));
  1501.       maxTimeBeBox.setEnabled(false);
  1502.  
  1503.       lblMins.setText("mins");
  1504.       lblMins.setForeground(Color.GRAY);
  1505.       lblMins.setFont(new Font("Cambria Math", Font.PLAIN, 13));
  1506.  
  1507.       label_3.setText("mins");
  1508.       label_3.setForeground(Color.GRAY);
  1509.       label_3.setFont(new Font("Cambria Math", Font.PLAIN, 13));
  1510.  
  1511.       minBreakBox.setText("15");
  1512.       minBreakBox.setForeground(Color.BLACK);
  1513.       minBreakBox.setFont(new Font("Cambria Math", Font.PLAIN, 13));
  1514.       minBreakBox.setEnabled(false);
  1515.  
  1516.       label_4.setText("mins");
  1517.       label_4.setForeground(Color.GRAY);
  1518.       label_4.setFont(new Font("Cambria Math", Font.PLAIN, 13));
  1519.  
  1520.       label_5.setText("to");
  1521.       label_5.setForeground(Color.GRAY);
  1522.       label_5.setFont(new Font("Cambria Math", Font.PLAIN, 13));
  1523.  
  1524.       maxBreakBox.setText("90");
  1525.       maxBreakBox.setForeground(Color.BLACK);
  1526.       maxBreakBox.setFont(new Font("Cambria Math", Font.PLAIN, 13));
  1527.       maxBreakBox.setEnabled(false);
  1528.  
  1529.       label_6.setText("mins");
  1530.       label_6.setForeground(Color.GRAY);
  1531.       label_6.setFont(new Font("Cambria Math", Font.PLAIN, 13));
  1532.       GroupLayout gl_panel_4 = new GroupLayout(panel_4);
  1533.       gl_panel_4.setHorizontalGroup(
  1534.         gl_panel_4.createParallelGroup(Alignment.LEADING)
  1535.           .addGroup(gl_panel_4.createSequentialGroup()
  1536.             .addContainerGap()
  1537.             .addGroup(gl_panel_4.createParallelGroup(Alignment.LEADING)
  1538.               .addGroup(gl_panel_4.createSequentialGroup()
  1539.                 .addComponent(breakBox)
  1540.                 .addGap(18)
  1541.                 .addComponent(randomBox, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  1542.                 .addGap(26))
  1543.               .addGroup(gl_panel_4.createSequentialGroup()
  1544.                 .addComponent(lblTimeBetweenBreaks, GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE)
  1545.                 .addGap(148))
  1546.               .addGroup(Alignment.TRAILING, gl_panel_4.createSequentialGroup()
  1547.                 .addGroup(gl_panel_4.createParallelGroup(Alignment.TRAILING)
  1548.                   .addGroup(gl_panel_4.createSequentialGroup()
  1549.                     .addGap(10)
  1550.                     .addComponent(minTimeBeBox, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE)
  1551.                     .addPreferredGap(ComponentPlacement.RELATED)
  1552.                     .addComponent(lblMins, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE)
  1553.                     .addGap(26)
  1554.                     .addComponent(lblTo)
  1555.                     .addPreferredGap(ComponentPlacement.RELATED, 25, Short.MAX_VALUE)
  1556.                     .addComponent(maxTimeBeBox, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE)
  1557.                     .addPreferredGap(ComponentPlacement.RELATED)
  1558.                     .addComponent(label_3, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE))
  1559.                   .addGroup(Alignment.LEADING, gl_panel_4.createSequentialGroup()
  1560.                     .addGap(10)
  1561.                     .addComponent(minBreakBox, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE)
  1562.                     .addPreferredGap(ComponentPlacement.RELATED)
  1563.                     .addComponent(label_4, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE)
  1564.                     .addGap(29)
  1565.                     .addComponent(label_5, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)
  1566.                     .addPreferredGap(ComponentPlacement.RELATED, 22, Short.MAX_VALUE)
  1567.                     .addComponent(maxBreakBox, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE)
  1568.                     .addPreferredGap(ComponentPlacement.RELATED)
  1569.                     .addComponent(label_6, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE))
  1570.                   .addComponent(lblBreakLengths, GroupLayout.DEFAULT_SIZE, 212, Short.MAX_VALUE))
  1571.                 .addGap(60))))
  1572.       );
  1573.       gl_panel_4.setVerticalGroup(
  1574.         gl_panel_4.createParallelGroup(Alignment.LEADING)
  1575.           .addGroup(gl_panel_4.createSequentialGroup()
  1576.             .addGap(17)
  1577.             .addGroup(gl_panel_4.createParallelGroup(Alignment.BASELINE)
  1578.               .addComponent(breakBox)
  1579.               .addComponent(randomBox))
  1580.             .addGap(18)
  1581.             .addComponent(lblTimeBetweenBreaks, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
  1582.             .addGap(5)
  1583.             .addGroup(gl_panel_4.createParallelGroup(Alignment.BASELINE)
  1584.               .addComponent(minTimeBeBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  1585.               .addComponent(lblMins, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
  1586.               .addComponent(lblTo)
  1587.               .addComponent(maxTimeBeBox, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
  1588.               .addComponent(label_3, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE))
  1589.             .addGap(18)
  1590.             .addComponent(lblBreakLengths, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
  1591.             .addPreferredGap(ComponentPlacement.RELATED)
  1592.             .addGroup(gl_panel_4.createParallelGroup(Alignment.BASELINE)
  1593.               .addComponent(minBreakBox, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
  1594.               .addComponent(label_4, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
  1595.               .addComponent(label_5, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
  1596.               .addComponent(maxBreakBox, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
  1597.               .addComponent(label_6, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE))
  1598.             .addContainerGap(47, Short.MAX_VALUE))
  1599.       );
  1600.       panel_4.setLayout(gl_panel_4);
  1601.       GroupLayout gl_panel_2 = new GroupLayout(panel_2);
  1602.       gl_panel_2.setHorizontalGroup(
  1603.         gl_panel_2.createParallelGroup(Alignment.LEADING)
  1604.           .addGroup(gl_panel_2.createSequentialGroup()
  1605.             .addComponent(panel_4, GroupLayout.PREFERRED_SIZE, 282, GroupLayout.PREFERRED_SIZE)
  1606.             .addContainerGap(34, Short.MAX_VALUE))
  1607.       );
  1608.       gl_panel_2.setVerticalGroup(
  1609.         gl_panel_2.createParallelGroup(Alignment.LEADING)
  1610.           .addComponent(panel_4, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  1611.       );
  1612.       panel_2.setLayout(gl_panel_2);
  1613.  
  1614.       submit.setText("Start");
  1615.       submit.setFont(new Font("Cambria Math", Font.BOLD, 12));
  1616.       submit.setBounds(108, 344, 89, 23);
  1617.       contentPane.add(submit);
  1618.       submit.addActionListener(new ActionListener() {
  1619.         @Override
  1620.         public void actionPerformed(ActionEvent e) {
  1621.           submitActionPerformed(e);
  1622.         }
  1623.       });
  1624.  
  1625.       // LOAD SAVED SELECTION INFO
  1626.       try {
  1627.         log("WTF GO");
  1628.                 String filename = GlobalConfiguration.Paths.getSettingsDirectory() + "\\AaimistersCKillerSettings.txt";
  1629.         Scanner in = new Scanner(new BufferedReader(new FileReader(filename)));
  1630.         log("WTF GO2");
  1631.         String line;
  1632.         String[] opts = {};
  1633.         while (in.hasNext()) {
  1634.                   line = in.next();
  1635.           log("WTF GO3");
  1636.           if (line.contains(":")) {
  1637.             opts = line.split(":");
  1638.           }
  1639.         }
  1640.         log("WTF GO4");
  1641.         in.close();
  1642.         if (opts.length > 1) {
  1643.           log("loading...");
  1644.           if (opts[9].equals("true")) {
  1645.             log("1");
  1646.             if (opts[10].equals("false")) {
  1647.               log("2");
  1648.               maxTimeBeBox.setText(opts[11]);
  1649.               minTimeBeBox.setText(opts[12]);
  1650.               maxBreakBox.setText(opts[13]);
  1651.               minBreakBox.setText(opts[14]);
  1652.             }
  1653.           }
  1654.           log("3");
  1655.           locationBox.setSelectedIndex(Integer.parseInt(opts[1]));
  1656.           log("4");
  1657.           statBox.setSelectedIndex(Integer.parseInt(opts[2]));
  1658.           log("5");
  1659.           colorBox.setSelectedIndex(Integer.parseInt(opts[3]));
  1660.           log("6");
  1661.           if (opts[0].equals("true")) {
  1662.             settingBox.setSelected(true);
  1663.           } else {
  1664.             settingBox.setSelected(false);
  1665.           }
  1666.           if (opts[4].equals("true")) {
  1667.             antibanBox.setSelected(true);
  1668.           } else {
  1669.             antibanBox.setSelected(false);
  1670.           }
  1671.           if (opts[5].equals("true")) {
  1672.             waitBox.setSelected(true);
  1673.           } else {
  1674.             waitBox.setSelected(false);
  1675.           }
  1676.           if (opts[6].equals("true")) {
  1677.             featherBox.setSelected(true);
  1678.           } else {
  1679.             featherBox.setSelected(false);
  1680.           }
  1681.           if (opts[7].equals("true")) {
  1682.             arrowBox.setSelected(true);
  1683.           } else {
  1684.             arrowBox.setSelected(false);
  1685.           }
  1686.           if (opts[8].equals("true")) {
  1687.             paintBox.setSelected(true);
  1688.           } else {
  1689.             paintBox.setSelected(false);
  1690.           }
  1691.           if (opts[9].equals("true")) {
  1692.             breakBox.setSelected(true);
  1693.           } else {
  1694.             breakBox.setSelected(false);
  1695.           }
  1696.           if (opts[10].equals("true")) {
  1697.             randomBox.setSelected(true);
  1698.           } else {
  1699.             randomBox.setSelected(false);
  1700.           }
  1701.         }
  1702.       } catch (final Exception e2) {
  1703.                 e2.printStackTrace();
  1704.         log.warning("Error loading settings.");
  1705.       }
  1706.       // END LOAD SAVED SELECTION INFO
  1707.       }
  1708.  
  1709.     private JFrame AaimistersGUI;
  1710.     private JPanel contentPane;
  1711.     private JCheckBox settingBox;
  1712.     private JComboBox locationBox;
  1713.     private JComboBox statBox;
  1714.     private JComboBox colorBox;
  1715.     private JCheckBox antibanBox;
  1716.     private JCheckBox waitBox;
  1717.     private JCheckBox featherBox;
  1718.     private JCheckBox arrowBox;
  1719.     private JCheckBox paintBox;
  1720.     private JCheckBox breakBox;
  1721.     private JCheckBox randomBox;
  1722.     private JTextArea maxTimeBeBox;
  1723.     private JTextArea minTimeBeBox;
  1724.     private JTextArea maxBreakBox;
  1725.     private JTextArea minBreakBox;
  1726.     private JPanel panel;
  1727.     private JPanel panel_1;
  1728.     private JPanel panel_2;
  1729.     private JPanel panel_4;
  1730.     private JLabel lblAaimistersEssenceMiner;
  1731.     private JLabel lblStatUsing;
  1732.     private JLabel lblLocation;
  1733.     private JLabel lblPaintColor;
  1734.     private JLabel lblTimeBetweenBreaks;
  1735.     private JLabel lblBreakLengths;
  1736.     private JLabel lblTo;
  1737.     private JLabel lblMins;
  1738.     private JLabel label_3;
  1739.     private JLabel label_4;
  1740.     private JLabel label_5;
  1741.     private JLabel label_6;
  1742.     private JTabbedPane tabbedPane;
  1743.     private JButton submit;
  1744.   }
  1745. }