- //Version 1.06
- //By Aaimister
- import java.util.Scanner;
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.Point;
- import java.awt.RenderingHints;
- import java.awt.SystemColor;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.event.KeyEvent;
- import java.awt.event.MouseEvent;
- import java.awt.event.MouseListener;
- import java.awt.event.WindowAdapter;
- import java.awt.event.WindowEvent;
- import java.io.*;
- import java.net.URL;
- import java.net.URLConnection;
- import java.text.DecimalFormat;
- import java.text.NumberFormat;
- import javax.swing.DefaultComboBoxModel;
- import javax.swing.GroupLayout;
- import javax.swing.GroupLayout.Alignment;
- import javax.swing.JButton;
- import javax.swing.JCheckBox;
- import javax.swing.JComboBox;
- import javax.swing.JFileChooser;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JOptionPane;
- import javax.swing.JPanel;
- import javax.swing.JTabbedPane;
- import javax.swing.JTextArea;
- import javax.swing.LayoutStyle.ComponentPlacement;
- import javax.swing.SwingConstants;
- import javax.swing.border.EmptyBorder;
- import javax.swing.border.MatteBorder;
- import org.rsbot.event.events.MessageEvent;
- import org.rsbot.event.listeners.MessageListener;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.util.Filter;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSGroundItem;
- import org.rsbot.script.wrappers.RSItem;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSPlayer;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.util.GlobalConfiguration;
- @ScriptManifest(authors = { "Aaimister" }, name = "Aaimisters Chicken Killer", keywords = "Combat", version = 1.06, description = ("Kills chickens."))
- public class AaimistersChickenKiller extends Script implements MessageListener, PaintListener, MouseListener {
- private RSTile InPen;
- private RSArea Pen;
- private RSArea ChickenPenF = new RSArea(new RSTile(3014, 3282), new RSTile(
- 3020, 3297));
- private RSArea ChickenPenLum = new RSArea(new RSTile(3225, 3295),
- new RSTile(3236, 3301));
- private RSArea ChickenPenFout = new RSArea(new RSTile(3026, 3282), new RSTile(3037, 3291));
- private RSArea Champion = new RSArea(new RSTile(3195, 3351), new RSTile(3199, 3360));
- private final String[] locationstring = { "Falador Pen", "Falador Porch", "Lumbridge Pen", "Champion's Guild" };
- private final String[] statstring = { "Attack", "Strength", "Defence", "Range" };
- private final String[] colorstring = { "Black", "Blue", "Cyan", "Green", "Lime", "Orange", "Pink", "Purple", "Red", "White", "Yellow" };
- private long nextBreak = System.currentTimeMillis();
- private long nextLength = 60000;
- private long startTime;
- final ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class);
- AaimistersGUI g = new AaimistersGUI();
- public final File settingsFile = new File(new File(GlobalConfiguration.Paths.getSettingsDirectory()),
- "AaimistersCKillerSettings.txt");
- Font Kat = new Font("KaiTi", Font.BOLD, 10);
- Color Black = new Color(0, 0, 0);
- Color Black90 = new Color(0, 0, 0, 90);
- Color Black150 = new Color(0, 0, 0, 150);
- Color White = new Color(255, 255, 255);
- Color MainColor;
- Color ClickC = new Color(187, 0, 0);
- Color PercentRed = new Color(163, 4, 0, 150);
- Color PercentGreen = new Color(0, 163, 4, 150);
- Color UpGreen = new Color(0, 169, 0);
- Color UpRed = new Color(169, 0, 0);
- final NumberFormat nf = NumberFormat.getInstance();
- public boolean currentlyBreaking = false;
- public boolean randomBreaks = false;
- public boolean buttonStats = false;
- public boolean waitForLoot = false;
- public boolean lootFeather = false;
- public boolean buttonMain = false;
- public boolean buttonInfo = false;
- public boolean buttonAll = false;
- public boolean antiBanOn = false;
- public boolean lootArrow = false;
- public boolean useSetting = true;
- public boolean showPaint = true;
- public boolean painting = false;
- public boolean doBreak = false;
- public boolean checkAmmo;
- public boolean outofAmmo;
- private boolean updated;
- private boolean done;
- private boolean closed;
- private String currentChic = "Chic Lvl 1";
- private String status = "";
- private String location = "";
- private String myName = "";
- int drop[] = { 526, 1925, 1944, 2138 };
- int Chickens[] = { 1017, 41 };
- int runEnergy = (random(40, 75));
- int arrow = 882;
- int feathers = 314;
- int antiCount = 0;
- int random;
- int pickItem;
- int stat;
- int priceArrow;
- int priceFeather;
- int xpToLvl;
- int xpHour;
- int timeToLvl;
- int gainedLvl;
- int startXP;
- int chicToLvl;
- int chicHour;
- int total;
- int currentXP;
- int totalChic;
- int xpGained;
- int xpChic;
- int maxBetween;
- int minBetween;
- int maxLength;
- int minLength;
- private enum State { BACKTOCHICK, ATTACK };
- private State getState() {
- if (!atPen()) {
- return State.BACKTOCHICK;
- } else {
- return State.ATTACK;
- }
- }
- public double getVersion() {
- return 1.06;
- }
- @Override
- public boolean onStart() {
- status = "Starting up...";
- URLConnection url = null;
- BufferedReader in = null;
- BufferedWriter out = null;
- //Check right away...
- try{
- //Open the version text file
- url = new URL("http://aaimister.webs.com/scripts/AaimistersChickenVersion.txt").openConnection();
- //Create an input stream for it
- in = new BufferedReader(new InputStreamReader(url.getInputStream()));
- //Check if the current version is outdated
- if(Double.parseDouble(in.readLine()) > getVersion()) {
- if(JOptionPane.showConfirmDialog(null, "Update found. Do you want to update?") == 0){
- updated = false;
- //If so, allow the user to choose the file to be updated.
- JOptionPane.showMessageDialog(null, "Please choose 'AaimistersChickenKiller.java' in your scripts folder and hit 'Open'");
- JFileChooser fc = new JFileChooser();
- //Make sure "Open" was clicked.
- if(fc.showOpenDialog(null) == JFileChooser.APPROVE_OPTION){
- //If so, set up the URL for the .java file and set up the IO.
- url = new URL("http://aaimister.webs.com/scripts/AaimistersChickenKiller.java").openConnection();
- in = new BufferedReader(new InputStreamReader(url.getInputStream()));
- out = new BufferedWriter(new FileWriter(fc.getSelectedFile().getPath()));
- String inp;
- /* Until we reach the end of the file, write the next line in the file
- * and add a new line. Then flush the buffer to ensure we lose
- * no data in the process.
- */
- while((inp = in.readLine()) != null){
- out.write(inp);
- out.newLine();
- out.flush();
- }
- //Notify the user that the script has been updated, and a recompile and reload is needed.
- log("Script successfully downloaded. Please recompile and reload your scripts!");
- return false;
- } else {
- log("Update canceled");
- }
- } else {
- log("Update canceled");
- }
- } else {
- JOptionPane.showMessageDialog(null, "You have the latest version.");//User has the latest version. Tell them!
- updated = true;
- if (in != null) {
- in.close();
- }
- }
- } catch (IOException e){
- log("Problem getting version. Please visit the forums.");
- updated = false;
- return false; //Return false if there was a problem
- }
- try {
- settingsFile.createNewFile();
- } catch (final IOException ignored) {
- }
- g.AaimistersGUI.setVisible(true);
- while (!done) {
- if (closed) {
- log.severe("The GUI window was closed!");
- return false;
- } else {
- sleep(random(50, 100));
- }
- }
- priceArrow = getGuidePrice(arrow);
- priceFeather = getGuidePrice(feathers);
- startTime = System.currentTimeMillis();
- startXP = skills.getCurrentExp(stat);
- currentXP = skills.getExpToNextLevel(stat);
- if (lootArrow) {
- log("Price of Arrows: " + priceArrow);
- }
- if (lootFeather) {
- log("Price of feathers: " + priceFeather);
- }
- breakingNew();
- return true;
- }
- public void onFinish() {
- long runTime = System.currentTimeMillis() - startTime;
- runTime = System.currentTimeMillis() - startTime;
- final String formattedTime = formatTime((int) runTime);
- log("Thanks for using Aaimister's Chicken Killer!");
- log("In " + formattedTime + " You killed " + totalChic + " chickens, and gained " + gainedLvl + " Level(s)!");
- }
- private void breakingNew(){
- if (randomBreaks){
- long varTime = random(3660000, 10800000);
- nextBreak = System.currentTimeMillis() + varTime;
- long varLength = random(900000, 3600000);
- nextLength = varLength;
- } else {
- int diff = random(0, 5) * 1000 * 60;
- long varTime = random((minBetween * 1000 * 60) + diff, (maxBetween * 1000 * 60) - diff);
- nextBreak = System.currentTimeMillis() + varTime;
- int diff2 = random(0, 5) * 1000 * 60;
- long varLength = random((minLength * 1000 * 60) + diff2, (maxLength * 1000 * 60) - diff2);
- nextLength = varLength;
- }
- }
- private boolean breakingCheck(){
- if (nextBreak <= System.currentTimeMillis()){
- return true;
- }
- return false;
- }
- private boolean atPen() {
- return Pen.contains(getMyPlayer().getLocation());
- }
- private boolean idle() {
- if (getMyPlayer().getAnimation() == -1) {
- return true;
- }
- return false;
- }
- public void dropAllExcept(boolean leftToRight, int... items) {
- while (inventory.getCountExcept(items) != 0) {
- if (!leftToRight) {
- for (int c = 0; c < 4; c++) {
- for (int r = 0; r < 7; r++) {
- boolean found = false;
- for (int i = 0; i < items.length && !found; ++i) {
- found = items[i] == inventory.getItems()[c + r * 4]
- .getID();
- }
- if (!found) {
- dropItem(c, r);
- }
- }
- }
- } else {
- for (int r = 0; r < 7; r++) {
- for (int c = 0; c < 4; c++) {
- boolean found = false;
- for (int i = 0; i < items.length && !found; ++i) {
- found = items[i] == inventory.getItems()[c + r * 4]
- .getID();
- }
- if (!found) {
- dropItem(c, r);
- }
- }
- }
- }
- sleep(random(500, 800));
- }
- }
- public void dropItem(int col, int row) {
- if (interfaces.get(210).getComponent(2).getText()
- .equals("Click here to continue")) {
- sleep(random(800, 1300));
- if (interfaces.get(210).getComponent(2).getText()
- .equals("Click here to continue")) {
- interfaces.get(210).getComponent(2).doClick();
- sleep(random(150, 200));
- }
- }
- if (game.getCurrentTab() != 4
- && !interfaces.get(762).isValid()
- && !interfaces.get(620).isValid()) {
- game.openTab(4);
- }
- if (col < 0 || col > 3 || row < 0 || row > 6)
- return;
- if (inventory.getItems()[col + row * 4].getID() == -1)
- return;
- Point p;
- p = mouse.getLocation();
- if (p.x < 563 + col * 42 || p.x >= 563 + col * 42 + 32
- || p.y < 213 + row * 36 || p.y >= 213 + row * 36 + 32) {
- mouse.hop(inventory.getInterface().getComponents()[row * 4 + col]
- .getCenter(), 10, 10);
- }
- mouse.click(false);
- sleep(100, 200);
- menu.doAction("drop");
- sleep(25, 50);
- }
- private void setCamera() {
- if (camera.getPitch() < 10) {
- camera.setPitch(true);
- sleep(1000, 1600);
- }
- }
- private void setRun() {
- if (!walking.isRunEnabled()) {
- if (walking.getEnergy() >= 50) {
- walking.setRun(true);
- sleep(1000, 1600);
- }
- }
- }
- private RSGroundItem pickupFeather() {
- return groundItems.getNearest(new Filter<RSGroundItem>() {
- public boolean accept(RSGroundItem g) {
- return g.getItem().getID() == feathers && Pen.contains(g.getLocation());
- }
- });
- }
- private RSGroundItem pickupArrow() {
- return groundItems.getNearest(new Filter<RSGroundItem>() {
- public boolean accept(RSGroundItem g) {
- return g.getItem().getID() == arrow && Pen.contains(g.getLocation());
- }
- });
- }
- private RSNPC newNPC() {
- RSNPC interacting = interactingNPC();
- return interacting != null ? interacting : npcs.getNearest(new Filter<RSNPC>() {
- public boolean accept(RSNPC npc) {
- return npc.getName().equals("Chicken") && npc.getHPPercent() > 0 && !npc.isInCombat() && Pen.contains(npc.getLocation());
- }
- });
- }
- private RSNPC interactingNPC() {
- return npcs.getNearest(new Filter<RSNPC>() {
- public boolean accept(RSNPC n) {
- return n.getInteracting() != null && n.getInteracting().equals(players.getMyPlayer()) && Pen.contains(n.getLocation());
- }
- });
- }
- private RSPlayer myPlayer() {
- return players.getNearest(new Filter<RSPlayer>() {
- public boolean accept(RSPlayer p) {
- return p.getName() != myName && Pen.contains(p.getLocation());
- }
- });
- }
- private RSPlayer playerNear() {
- RSPlayer me = myPlayer();
- return me != null ? me : players.getNearest(new Filter<RSPlayer>() {
- public boolean accept(RSPlayer p) {
- return Pen.contains(p.getLocation()) && !p.isMoving();
- }
- });
- }
- @Override
- public int loop() {
- if (breakingCheck() && doBreak) {
- status = "Breaking...";
- long endTime = System.currentTimeMillis() + nextLength;
- currentlyBreaking = true;
- while (game.isLoggedIn()) {
- game.logout(true);
- sleep(50);
- }
- log("Taking a break for " + formatTime((int) nextLength));
- while (System.currentTimeMillis() < endTime && currentlyBreaking == true){
- sleep(1000);
- }
- currentlyBreaking = false;
- while (!game.isLoggedIn()) {
- try {
- breakingNew();
- game.login();
- } catch (Exception e) {
- return 10;
- }
- sleep(50);
- }
- return 10;
- }
- if (!game.isLoggedIn()) {
- return 3000;
- }
- myName = players.getMyPlayer().getName();
- setCamera();
- setRun();
- mouse.setSpeed(random(5, 12));
- switch (getState()) {
- case ATTACK:
- status = "Killing chickens...";
- if (atPen()) {
- antiCount = (random(0, 6));
- if (checkAmmo) {
- checkAmmo = false;
- RSItem wield = inventory.getItem(arrow);
- if (game.getCurrentTab() != 4) {
- game.openTab(4);
- } else {
- if (inventory.contains(arrow)) {
- wield.doAction("Wield");
- return random(800, 1000);
- } else {
- outofAmmo = true;
- }
- }
- }
- if (players.getMyPlayer().getInteracting() != null) {
- if (interfaces.canContinue()) {
- interfaces.clickContinue();
- }
- return random(900, 1100);
- }
- if (idle() && (players.getMyPlayer().getInteracting() == null)) {
- RSItem junk = inventory.getItem(drop);
- if (junk != null) {
- junk.doAction("Drop");
- return random(800, 1000);
- }
- try {
- if (lootFeather) {
- RSGroundItem feathers = pickupFeather();
- if (feathers != null) {
- if (players.getMyPlayer().isMoving()) {
- return random(400, 600);
- }
- if (!feathers.isOnScreen()) {
- RSTile featherT = walking.getClosestTileOnMap(feathers.getLocation()).randomize(-1, 1);
- if (Pen.contains(featherT)) {
- walking.walkTileMM(featherT);
- } else {
- return 100;
- }
- return random(900, 1200);
- }
- feathers.doAction("Take Feather");
- return random(900, 1100);
- }
- }
- } catch (Exception e) {
- log("Just a mis-click. =]");
- }
- try {
- if (lootArrow) {
- RSGroundItem arrow = pickupArrow();
- if (arrow != null) {
- if (players.getMyPlayer().isMoving()) {
- return random(400, 600);
- }
- if (!arrow.isOnScreen()) {
- RSTile arrowT = walking.getClosestTileOnMap(arrow.getLocation()).randomize(-1, 1);
- if (Pen.contains(arrowT)) {
- walking.walkTileMM(arrowT);
- } else {
- return 100;
- }
- return random(900, 1200);
- }
- arrow.doAction("Take Bronze");
- return random(900, 1100);
- }
- }
- } catch (Exception e) {
- log("Just a mis-click. =]");
- }
- try {
- RSNPC chic = newNPC();
- if (chic != null) {
- if (players.getMyPlayer().isMoving()) {
- return random(400, 600);
- }
- if (chic.isOnScreen()) {
- chic.doAction("Attack " + chic.getName());
- return random(1000, 1600);
- } else if (!chic.isOnScreen()) {
- RSTile chicT = walking.getClosestTileOnMap(chic.getLocation()).randomize(-1, 1);
- if (Pen.contains(chicT)) {
- walking.walkTileMM(chicT);
- } else {
- return 100;
- }
- if (waitForLoot) {
- sleep(2800, 3500);
- }
- return random(1100, 1500);
- }
- }
- } catch (Exception e) {
- log("Just a mis-click. =]");
- }
- if (antiCount == (random(0, 6))) {
- doAntiBan();
- return random(1000, 1600);
- }
- }
- if (antiCount == (random(0, 6))) {
- doAntiBan();
- return random(1000, 1600);
- }
- }
- break;
- case BACKTOCHICK:
- status = "Finding pen...";
- if (!atPen()) {
- if (!idle() || getMyPlayer().isInCombat()) {
- return random(1000, 1500);
- }
- if (idle() && !getMyPlayer().isInCombat()) {
- RSTile Next = walking.getClosestTileOnMap(InPen).randomize(-2, 2);
- walking.walkTileMM(Next);
- sleep(1000, 1500);
- } else {
- return random(1000, 1600);
- }
- }
- break;
- }
- return (random(650, 1050));
- }
- //Credits Aion
- private int getGuidePrice(int itemID) {
- try {
- URL url = new URL(
- "http://services.runescape.com/m=itemdb_rs/viewitem.ws?obj="
- + itemID);
- BufferedReader br = new BufferedReader(new InputStreamReader(
- url.openStream()));
- String line = null;
- while ((line = br.readLine()) != null) {
- if (line.contains("<b>Current guide price:</b>")) {
- line = line.replace("<b>Current guide price:</b>", "");
- return (int) parse(line);
- }
- }
- } catch (IOException e) {
- }
- return -1;
- }
- //Credits Aion
- private double parse(String str) {
- if (str != null && !str.isEmpty()) {
- str = stripFormatting(str);
- str = str.substring(str.indexOf(58) + 2, str.length());
- str = str.replace(",", "");
- if (!str.endsWith("%")) {
- if (!str.endsWith("k") && !str.endsWith("m")) {
- return Double.parseDouble(str);
- }
- return Double.parseDouble(str.substring(0, str.length() - 1))
- * (str.endsWith("m") ? 1000000 : 1000);
- }
- int k = str.startsWith("+") ? 1 : -1;
- str = str.substring(1);
- return Double.parseDouble(str.substring(0, str.length() - 1)) * k;
- }
- return -1D;
- }
- public void doAntiBan() {
- if (antiBanOn == false) {
- return;
- }
- int action = random(0, 8);
- switch (action) {
- case 0:
- random = (random(1, 3));
- if (random == random(0, 4)) {
- rotateCamera();
- sleep(200, 400);
- antiCount = (random(0, 6));
- } else {
- return;
- }
- break;
- case 1:
- mouse.moveRandomly(100, 900);
- sleep(200, 400);
- antiCount = (random(0, 6));
- break;
- case 2:
- random = (random(1, 3));
- if (random == random(0, 4)) {
- checkPlayer();
- sleep(200, 400);
- antiCount = (random(0, 6));
- } else {
- return;
- }
- break;
- case 3:
- random = (random(1, 6));
- if (random == random(0, 7)) {
- rotateCamera();
- sleep(200, 400);
- antiCount = (random(0, 6));
- } else {
- return;
- }
- break;
- case 4:
- mouse.moveRandomly(100, 900);
- sleep(200, 400);
- antiCount = (random(0, 6));
- break;
- case 5:
- random = (random(1, 6));
- if (random == random(0, 7)) {
- checkEXP();
- sleep(200, 400);
- antiCount = (random(0, 6));
- } else {
- return;
- }
- break;
- case 6:
- mouse.moveRandomly(100, 900);
- sleep(200, 400);
- antiCount = (random(0, 6));
- break;
- case 7:
- random = (random(1, 6));
- if (random == random(0, 7)) {
- randomTile();
- sleep(200, 400);
- antiCount = (random(0, 6));
- } else {
- return;
- }
- }
- }
- public void randomTile() {
- RSTile random = InPen.randomize(-5, 5);
- if (Pen.contains(random)) {
- if (idle()) {
- walking.walkTileMM(walking.getClosestTileOnMap(random));
- sleep(1200, 1500);
- }
- } else {
- return;
- }
- }
- public void checkPlayer() {
- RSPlayer near = playerNear();
- if (near != null) {
- if (!players.getMyPlayer().isMoving()) {
- if (near.getScreenLocation() != null) {
- if (mouse.getLocation() != near.getScreenLocation()) {
- mouse.move(near.getScreenLocation());
- sleep(300, 550);
- }
- mouse.click(false);
- sleep(300, 500);
- if (menu.contains("Follow")) {
- Point menuu = menu.getLocation();
- int Mx = menuu.y;
- int My = menuu.y;
- int x = Mx + random(3, 120);
- int y = My + random(3, 98);
- mouse.move(x, y);
- sleep(2320, 3520);
- mouse.moveRandomly(100, 900);
- if (menu.isOpen()) {
- mouse.moveRandomly(100, 900);
- }
- } else {
- mouse.moveRandomly(100, 900);
- }
- }
- } else {
- return;
- }
- }
- }
- public void checkEXP() {
- if (game.getCurrentTab() != 1) {
- game.openTab(1);
- sleep(500, 900);
- }
- if (stat == 0) {
- mouse.move(random(551, 604), random(214, 233));
- sleep(3000, 5500);
- game.openTab(4);
- sleep(50, 100);
- mouse.moveRandomly(50, 900);
- } else if (stat == 1) {
- mouse.move(random(551, 604), random(269, 289));
- sleep(3000, 5500);
- game.openTab(4);
- sleep(50, 100);
- mouse.moveRandomly(50, 900);
- } else if (stat == 2) {
- mouse.move(random(551, 604), random(241, 261));
- sleep(3000, 5500);
- game.openTab(4);
- sleep(50, 100);
- mouse.moveRandomly(50, 900);
- } else if (stat == 4) {
- mouse.move(random(551, 604), random(298, 316));
- sleep(3000, 5500);
- game.openTab(4);
- sleep(50, 100);
- mouse.moveRandomly(50, 900);
- }
- }
- public void rotateCamera() {
- final char[] LR = new char[] { KeyEvent.VK_LEFT,
- KeyEvent.VK_RIGHT };
- final char[] DU = new char[] { KeyEvent.VK_DOWN,
- KeyEvent.VK_UP };
- int x = random(0, 2);
- int key = 0;
- keyboard.pressKey(LR[x]);
- if (getMyPlayer().getAnimation() != -1) {
- keyboard.pressKey(DU[1]);
- key = 0;
- }
- sleep(500, 1000);
- keyboard.releaseKey(DU[key]);
- keyboard.releaseKey(LR[x]);
- }
- private String stripFormatting(String str) {
- if (str != null && !str.isEmpty())
- return str.replaceAll("(^[^<]+>|<[^>]+>|<[^>]+$)", "");
- return "";
- }
- @Override
- public void messageReceived(MessageEvent e) {
- if (stat == 0) {
- if (e.getMessage().contains("You've just advanced an Attack")) {
- gainedLvl++;
- }
- } else if (stat == 1) {
- if (e.getMessage().contains("You've just advanced a Defence")) {
- gainedLvl++;
- }
- } else if (stat == 2) {
- if (e.getMessage().contains("You've just advanced a Strength")) {
- gainedLvl++;
- }
- } else if (stat == 4) {
- if (e.getMessage().contains("You've just advanced a Ranged")) {
- gainedLvl++;
- }
- if (e.getMessage().contains("There is no ammo")) {
- checkAmmo = true;
- if (outofAmmo) {
- log("Out of ammo. =/");
- stopScript();
- }
- }
- }
- }
- public void drawMouse(final Graphics g) {
- final Point loc = mouse.getLocation();
- final long mpt = System.currentTimeMillis() - mouse.getPressTime();
- if (mouse.getPressTime() == -1 || mpt >= 1000) {
- g.setColor(MainColor);
- g.fillRect(loc.x - 1, loc.y - 1, 3, 3);
- g.drawLine(0, loc.y, 766, loc.y);
- g.drawLine(loc.x, 0, loc.x, 505);
- }
- if (mpt < 1000) {
- g.setColor(ClickC);
- g.fill3DRect(loc.x - 1, loc.y - 1, 3, 3, true);
- g.drawLine(0, loc.y, 766, loc.y);
- g.drawLine(loc.x, 0, loc.x, 505);
- }
- }
- public void mouseClicked(MouseEvent e){
- }
- public void mouseEntered(MouseEvent e){
- }
- public void mouseExited(MouseEvent e){
- }
- public void mousePressed(MouseEvent e){
- if (e.getX() >= 220 && e.getX() < 220 + 75 && e.getY() >= 322 && e.getY() < 322 + 12) {
- if (!buttonMain) {
- buttonMain = true;
- } else {
- buttonMain = false;
- }
- }
- if (e.getX() >= 300 && e.getX() < 300 + 75 && e.getY() >= 322 && e.getY() < 322 + 12) {
- if (!buttonStats) {
- buttonStats = true;
- } else {
- buttonStats = false;
- }
- }
- if (e.getX() >= 380 && e.getX() < 380 + 75 && e.getY() >= 322 && e.getY() < 322 + 12) {
- if (!buttonInfo) {
- buttonInfo = true;
- } else {
- buttonInfo = false;
- }
- }
- if (e.getX() >= 460 && e.getX() < 460 + 50 && e.getY() >= 322 && e.getY() < 322 + 12) {
- if (!buttonAll) {
- buttonAll = true;
- } else {
- buttonAll = false;
- }
- }
- }
- public void mouseReleased(MouseEvent e){
- }
- String formatTime(final int milliseconds) {
- final long t_seconds = milliseconds / 1000;
- final long t_minutes = t_seconds / 60;
- final long t_hours = t_minutes / 60;
- final int seconds = (int) (t_seconds % 60);
- final int minutes = (int) (t_minutes % 60);
- final int hours = (int) (t_hours % 60);
- return (nf.format(hours) + ":" + nf.format(minutes) + ":" + nf.format(seconds));
- }
- public void onRepaint(Graphics g) {
- long runTime = System.currentTimeMillis() - startTime;
- runTime = System.currentTimeMillis() - startTime;
- final String formattedTime = formatTime((int) runTime);
- currentXP = skills.getExpToNextLevel(stat);
- NumberFormat formatter = new DecimalFormat("#,###,###");
- xpChic = (int) (30 * 0.4);
- xpToLvl = skills.getExpToNextLevel(stat);
- xpGained = skills.getCurrentExp(stat) - startXP;
- xpHour = ((int) ((3600000.0 / (double) runTime) * xpGained));
- timeToLvl = (int) (((double) xpToLvl / (double) xpHour) * 3600000.0);
- totalChic = (int) (xpGained / (double) xpChic);
- total = (xpChic * totalChic);
- chicHour = (int) ((3600000.0 / (double) runTime) * totalChic);
- chicToLvl = (int) (currentXP / (double) xpChic);
- if (painting) {
- ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
- ((Graphics2D)g).setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
- ((Graphics2D)g).setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
- }
- // main bar
- g.setColor(MainColor);
- g.fillRoundRect(4, 318, 512, 20, 5, 10);
- g.setColor(Black);
- g.drawRoundRect(4, 318, 512, 20, 5, 10);
- // % bar
- g.setColor(Black);
- g.fillRoundRect(10, 322, 200, 12, 5, 10);
- g.setColor(PercentRed);
- g.fillRoundRect(10, 322, 200, 12, 5, 10);
- g.setColor(PercentGreen);
- g.fillRoundRect(10, 322, skills.getPercentToNextLevel(stat) * 2, 12, 5, 10);
- g.setColor(Black);
- g.drawRoundRect(10, 322, 200, 12, 5, 10);
- g.setFont(new Font("KaiTi", Font.BOLD, 10));
- g.setColor(White);
- g.drawString("" + skills.getPercentToNextLevel(stat) + "%", 101, 332);
- // Button Main
- g.setColor(Black150);
- g.fillRoundRect(220, 322, 75, 12, 5, 10);
- g.setColor(Black);
- g.drawRoundRect(220, 322, 75, 12, 5, 10);
- g.setFont(Kat);
- g.setColor(White);
- g.drawString("Main", 248, 332);
- if (buttonMain) {
- g.setColor(Black150);
- g.fillRoundRect(220, 322, 75, 12, 5, 10);
- g.drawString("Main", 248, 332);
- // Box
- g.setColor(Black150);
- g.fillRoundRect(95, 246, 200, 72, 5, 10);
- g.setColor(Black);
- g.drawRoundRect(95, 246, 200, 72, 5, 10);
- g.setColor(White);
- g.setFont(Kat);
- g.drawString("Chic(s) Killed: " + formatter.format((long)(totalChic)), 100, 263);
- g.drawString("Chic(s) / Hour: " + formatter.format((long)(chicHour)), 100, 278);
- g.drawString("Chic Killing: " + currentChic, 100, 295);
- g.drawString("Chic(s) to Lvl: " + formatter.format((long)(chicToLvl)), 100, 310);
- }
- // Button Stats
- g.setColor(Black150);
- g.fillRoundRect(300, 322, 75, 12, 5, 10);
- g.setColor(Black);
- g.drawRoundRect(300, 322, 75, 12, 5, 10);
- g.setFont(Kat);
- g.setColor(White);
- g.drawString("Stats", 327, 332);
- if (buttonStats) {
- g.setColor(Black150);
- g.fillRoundRect(300, 322, 75, 12, 5, 10);
- g.drawString("Stats", 327, 332);
- // Box
- g.setColor(Black150);
- g.fillRoundRect(175, 216, 200, 102, 5, 10);
- g.setColor(Black);
- g.drawRoundRect(175, 216, 200, 102, 5, 10);
- g.setColor(White);
- g.setFont(Kat);
- g.drawString("Total XP: " + formatter.format((long)(total)), 180, 233);
- g.drawString("XP / Hour: " + formatter.format((long)(xpHour)), 180, 248);
- g.drawString("XP to Lvl: " + formatter.format((long)(currentXP)), 180, 263);
- g.drawString("Lvl in: " + formatTime(timeToLvl), 180, 278);
- g.drawString("Current Lvl: " + (skills.getCurrentLevel(stat)), 180,
- 295);
- g.drawString("Gained Lvl(s): " + gainedLvl, 180, 310);
- }
- // Button Info
- g.setColor(Black150);
- g.fillRoundRect(380, 322, 75, 12, 5, 10);
- g.setColor(Black);
- g.drawRoundRect(380, 322, 75, 12, 5, 10);
- g.setFont(Kat);
- g.setColor(White);
- g.drawString("Info", 408, 332);
- if (buttonInfo) {
- g.setColor(Black150);
- g.fillRoundRect(380, 322, 75, 12, 5, 10);
- g.drawString("Info", 408, 332);
- // Box
- g.setColor(Black150);
- g.fillRoundRect(255, 231, 200, 87, 5, 10);
- g.setColor(Black);
- g.drawRoundRect(255, 231, 200, 87, 5, 10);
- g.setColor(White);
- g.setFont(Kat);
- g.drawString("Time running: " + formattedTime, 260, 248);
- g.drawString("Location: " + location, 260, 263);
- g.drawString("Status: " + status, 260, 278);
- g.drawString("Version: " + 1.06, 260, 295);
- if (updated) {
- g.setColor(UpGreen);
- g.drawString("By: Aaimister", 260, 312);
- } else {
- g.setColor(UpRed);
- g.drawString("By: Aaimister", 260, 312);
- }
- }
- // ALL
- g.setColor(Black150);
- g.fillRoundRect(460, 322, 50, 12, 5, 10);
- g.setColor(Black);
- g.drawRoundRect(460, 322, 50, 12, 5, 10);
- g.setFont(Kat);
- g.setColor(White);
- g.drawString("All", 477, 332);
- if (buttonAll) {
- g.setColor(Black150);
- g.fillRoundRect(460, 322, 50, 12, 5, 10);
- g.drawString("All", 477, 332);
- // Box
- g.setColor(Black150);
- g.fillRoundRect(310, 81, 200, 237, 5, 10);
- g.setColor(Black);
- g.drawRoundRect(310, 81, 200, 237, 5, 10);
- g.setColor(White);
- g.setFont(Kat);
- g.drawString("Chic(s) Killed: " + formatter.format((long)(totalChic)), 315, 98);
- g.drawString("Chic(s) / Hour: " + formatter.format((long)(chicHour)), 315, 113);
- g.drawString("Chic Killing: " + currentChic, 315, 128);
- g.drawString("Chic(s) to Lvl: " + formatter.format((long)(chicToLvl)), 315, 143);
- g.drawString("Total XP: " + formatter.format((long)(total)), 315, 158);
- g.drawString("XP / Hour: " + formatter.format((long)(xpHour)), 315, 173);
- g.drawString("XP to Lvl: " + formatter.format((long)(currentXP)), 315, 188);
- g.drawString("Lvl in: " + formatTime(timeToLvl), 315, 203);
- g.drawString("Current Lvl: " + (skills.getCurrentLevel(stat)), 315,
- 218);
- g.drawString("Gained Lvl(s): " + gainedLvl, 315, 233);
- g.drawString("Time running: " + formattedTime, 315, 248);
- g.drawString("Location: " + location, 315, 263);
- g.drawString("Status: " + status, 315, 278);
- g.drawString("Version: " + 1.06, 315, 295);
- if (updated) {
- g.setColor(UpGreen);
- g.drawString("By: Aaimister", 315, 310);
- } else {
- g.setColor(UpRed);
- g.drawString("By: Aaimister", 315, 310);
- }
- }
- //Shadow
- g.setColor(Black90);
- g.fillRoundRect(4, 329, 512, 9, 5, 10);
- //Mouse
- drawMouse(g);
- }
- public class AaimistersGUI {
- private static final long serialVersionUID = 1L;
- private AaimistersGUI() {
- initComponents();
- }
- private void submitActionPerformed(ActionEvent e) {
- String color = colorBox.getSelectedItem().toString();
- if (color.contains("Blue")) {
- MainColor = new Color(0, 0, 187, 190);
- } else if (color.contains("Black")) {
- MainColor = new Color(0, 0, 0, 190);
- } else if (color.contains("Cyan")) {
- MainColor = new Color(0, 187, 187, 190);
- } else if (color.contains("Green")) {
- MainColor = new Color(0, 187, 0, 190);
- } else if (color.contains("Lime")) {
- MainColor = new Color(0, 255, 0, 190);
- } else if (color.contains("Orange")) {
- MainColor = new Color(255, 120, 0, 190);
- } else if (color.contains("Pink")) {
- MainColor = new Color(255, 0, 120, 190);
- } else if (color.contains("Purple")) {
- MainColor = new Color(120, 0, 255, 190);
- } else if (color.contains("Red")) {
- MainColor = new Color(187, 0, 0, 190);
- ClickC = Black;
- } else if (color.contains("White")) {
- MainColor = new Color(255, 255, 255, 190);
- } else if (color.contains("Yellow")) {
- MainColor = new Color(255, 255, 0, 190);
- }
- String chosen = locationBox.getSelectedItem().toString();
- if (chosen.contains("Falador Pen")) {
- InPen = new RSTile(3017, 3290);
- Pen = ChickenPenF;
- location = "Falador Pen";
- } else if (chosen.contains("Falador Porch")) {
- InPen = new RSTile(3032, 3286);
- Pen = ChickenPenFout;
- location = "Falador Porch";
- } else if (chosen.contains("Lumbridge Pen")) {
- InPen = new RSTile(3231, 3297);
- Pen = ChickenPenLum;
- location = "NorthWest Lum.";
- } else if (chosen.contains("Champion's Guild")) {
- InPen = new RSTile(3197, 3355);
- Pen = Champion;
- location = "Champion's Guild";
- }
- String stats = statBox.getSelectedItem().toString();
- if (stats.contains("Attack")) {
- stat = 0;
- } else if (stats.contains("Strength")) {
- stat = 2;
- } else if (stats.contains("Defence")) {
- stat = 1;
- } else if (stats.contains("Range")) {
- stat = 4;
- }
- if (waitBox.isSelected()) {
- waitForLoot = true;
- }
- if (arrowBox.isSelected()) {
- lootArrow = true;
- }
- if (featherBox.isSelected()) {
- lootFeather = true;
- }
- if (paintBox.isSelected()) {
- painting = true;
- }
- if (antibanBox.isSelected()) {
- antiBanOn = true;
- }
- if (settingBox.isSelected()) {
- useSetting = true;
- }
- if (breakBox.isSelected()) {
- doBreak = true;
- if (randomBox.isSelected()) {
- randomBreaks = true;
- }
- maxBetween = Integer.parseInt(maxTimeBeBox.getText());
- minBetween = Integer.parseInt(minTimeBeBox.getText());
- maxLength = Integer.parseInt(maxBreakBox.getText());
- minLength = Integer.parseInt(minBreakBox.getText());
- if (minBetween < 1) {
- minBetween = 1;
- }
- if (minLength < 1) {
- minLength = 1;
- }
- if (maxBetween > 5000) {
- maxBetween = 5000;
- } else if (maxBetween < 6) {
- maxBetween = 6;
- }
- if (maxLength > 5000) {
- maxLength = 5000;
- } else if (maxLength < 5) {
- maxLength = 5;
- }
- }
- // Write settings
- try {
- final BufferedWriter out = new BufferedWriter(new FileWriter(settingsFile));
- out.write((settingBox.isSelected() ? true : false)
- + ":" // 0
- + (locationBox.getSelectedIndex())
- + ":" // 1
- + (statBox.getSelectedIndex())
- + ":" // 2
- + (colorBox.getSelectedIndex())
- + ":" // 3
- + (antibanBox.isSelected() ? true : false)
- + ":" // 4
- + (waitBox.isSelected() ? true : false)
- + ":" // 5
- + (featherBox.isSelected() ? true : false)
- + ":" // 6
- + (arrowBox.isSelected() ? true : false)
- + ":" // 7
- + (paintBox.isSelected() ? true : false)
- + ":" // 8
- + (breakBox.isSelected() ? true : false)
- + ":" // 9
- + (randomBox.isSelected() ? true : false)
- + ":" // 10
- + (maxTimeBeBox.getText())
- + ":" // 11
- + (minTimeBeBox.getText())
- + ":" // 12
- + (maxBreakBox.getText())
- + ":" // 13
- + (minBreakBox.getText()));// 14
- out.close();
- } catch (final Exception e1) {
- log.warning("Error saving setting.");
- }
- // End write settings
- done = true;
- AaimistersGUI.dispose();
- }
- private void breakBoxActionPerformed(ActionEvent e) {
- doBreak = breakBox.isSelected();
- randomBreaks = randomBox.isSelected();
- if (!doBreak) {
- randomBox.setEnabled(false);
- randomBox.setSelected(false);
- maxTimeBeBox.setEnabled(false);
- minTimeBeBox.setEnabled(false);
- maxBreakBox.setEnabled(false);
- minBreakBox.setEnabled(false);
- } else {
- randomBox.setEnabled(true);
- if (!randomBreaks) {
- maxTimeBeBox.setEnabled(true);
- minTimeBeBox.setEnabled(true);
- maxBreakBox.setEnabled(true);
- minBreakBox.setEnabled(true);
- }
- }
- }
- private void randomBoxActionPerformed(ActionEvent e) {
- randomBreaks = randomBox.isSelected();
- if (randomBreaks == true) {
- maxTimeBeBox.setEnabled(false);
- minTimeBeBox.setEnabled(false);
- maxBreakBox.setEnabled(false);
- minBreakBox.setEnabled(false);
- } else {
- if (doBreak) {
- maxTimeBeBox.setEnabled(true);
- minTimeBeBox.setEnabled(true);
- maxBreakBox.setEnabled(true);
- minBreakBox.setEnabled(true);
- }
- }
- }
- private void initComponents() {
- AaimistersGUI = new JFrame();
- contentPane = new JPanel();
- settingBox = new JCheckBox();
- locationBox = new JComboBox();
- statBox = new JComboBox();
- colorBox = new JComboBox();
- antibanBox = new JCheckBox();
- waitBox = new JCheckBox();
- featherBox = new JCheckBox();
- arrowBox = new JCheckBox();
- paintBox = new JCheckBox();
- breakBox = new JCheckBox();
- randomBox = new JCheckBox();
- maxTimeBeBox = new JTextArea();
- minTimeBeBox = new JTextArea();
- maxBreakBox = new JTextArea();
- minBreakBox = new JTextArea();
- panel = new JPanel();
- panel_1 = new JPanel();
- panel_2 = new JPanel();
- panel_4 = new JPanel();
- lblAaimistersEssenceMiner = new JLabel();
- lblStatUsing = new JLabel();
- lblLocation = new JLabel();
- lblPaintColor = new JLabel();
- lblTimeBetweenBreaks = new JLabel();
- lblBreakLengths = new JLabel();
- lblTo = new JLabel();
- lblMins = new JLabel();
- label_3 = new JLabel();
- label_4 = new JLabel();
- label_5 = new JLabel();
- label_6 = new JLabel();
- tabbedPane = new JTabbedPane(JTabbedPane.TOP);
- submit = new JButton();
- // Listeners
- AaimistersGUI.addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
- closed = true;
- }
- });
- AaimistersGUI.setTitle("Aaimister's Chicken Killer v1.06");
- AaimistersGUI.setForeground(new Color(255, 255, 255));
- AaimistersGUI.setBackground(Color.LIGHT_GRAY);
- AaimistersGUI.setResizable(false);
- AaimistersGUI.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
- AaimistersGUI.setBounds(100, 100, 300, 400);
- AaimistersGUI.setContentPane(contentPane);
- contentPane.setBackground(SystemColor.menu);
- contentPane.setForeground(Color.LIGHT_GRAY);
- contentPane.setFont(new Font("Cambria Math", Font.PLAIN, 17));
- contentPane.setBorder(new EmptyBorder(5, 8, 8, 8));
- contentPane.setLayout(null);
- panel.setBorder(new MatteBorder(0, 0, 1, 0, (Color) new Color(0, 0, 0)));
- panel.setBounds(4, 0, 296, 40);
- contentPane.add(panel);
- panel.setLayout(null);
- lblAaimistersEssenceMiner.setText("Aaimister's Chicken Killer v1.06");
- lblAaimistersEssenceMiner.setBounds(0, 0, 296, 40);
- panel.add(lblAaimistersEssenceMiner);
- lblAaimistersEssenceMiner.setHorizontalAlignment(SwingConstants.CENTER);
- lblAaimistersEssenceMiner.setForeground(SystemColor.infoText);
- lblAaimistersEssenceMiner.setFont(new Font("Calibri", Font.BOLD, 20));
- tabbedPane.setBounds(4, 51, 286, 282);
- contentPane.add(tabbedPane);
- tabbedPane.addTab("General", null, panel_1, null);
- waitBox.setText("Wait For Loot");
- waitBox.setForeground(Color.BLACK);
- waitBox.setFont(new Font("Cambria Math", Font.PLAIN, 12));
- arrowBox.setText("Loot Arrows");
- arrowBox.setForeground(Color.BLACK);
- arrowBox.setFont(new Font("Cambria Math", Font.PLAIN, 12));
- featherBox.setText("Loot Feathers");
- featherBox.setForeground(Color.BLACK);
- featherBox.setFont(new Font("Cambria Math", Font.PLAIN, 12));
- featherBox.setSelected(true);
- paintBox.setText("Enable Anti-Aliasing");
- paintBox.setForeground(Color.BLACK);
- paintBox.setFont(new Font("Cambria Math", Font.PLAIN, 12));
- paintBox.setSelected(true);
- lblStatUsing.setText("Stat Using:");
- lblStatUsing.setForeground(Color.BLACK);
- lblStatUsing.setFont(new Font("Cambria Math", Font.PLAIN, 15));
- lblLocation.setText("Location:");
- lblLocation.setForeground(Color.BLACK);
- lblLocation.setFont(new Font("Cambria Math", Font.PLAIN, 15));
- lblPaintColor.setText("Paint Color:");
- lblPaintColor.setForeground(Color.BLACK);
- lblPaintColor.setFont(new Font("Cambria Math", Font.PLAIN, 15));
- statBox.setModel(new DefaultComboBoxModel(statstring));
- locationBox.setModel(new DefaultComboBoxModel(locationstring));
- colorBox.setModel(new DefaultComboBoxModel(colorstring));
- antibanBox.setText("Use Anti-Ban");
- antibanBox.setSelected(true);
- antibanBox.setForeground(Color.BLACK);
- antibanBox.setFont(new Font("Cambria Math", Font.PLAIN, 12));
- settingBox.setText("Save Settings");
- settingBox.setSelected(true);
- settingBox.setForeground(Color.BLACK);
- settingBox.setFont(new Font("Cambria Math", Font.PLAIN, 12));
- GroupLayout gl_panel_1 = new GroupLayout(panel_1);
- gl_panel_1.setHorizontalGroup(
- gl_panel_1.createParallelGroup(Alignment.LEADING)
- .addGroup(gl_panel_1.createSequentialGroup()
- .addGap(28)
- .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING)
- .addGroup(gl_panel_1.createSequentialGroup()
- .addComponent(antibanBox, GroupLayout.PREFERRED_SIZE, 107, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(ComponentPlacement.UNRELATED)
- .addComponent(settingBox, GroupLayout.PREFERRED_SIZE, 107, GroupLayout.PREFERRED_SIZE))
- .addGroup(gl_panel_1.createSequentialGroup()
- .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING)
- .addComponent(lblStatUsing, GroupLayout.PREFERRED_SIZE, 79, GroupLayout.PREFERRED_SIZE)
- .addComponent(lblPaintColor, GroupLayout.PREFERRED_SIZE, 79, GroupLayout.PREFERRED_SIZE)
- .addComponent(lblLocation, GroupLayout.PREFERRED_SIZE, 79, GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(ComponentPlacement.UNRELATED)
- .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING)
- .addComponent(locationBox, GroupLayout.PREFERRED_SIZE, 102, GroupLayout.PREFERRED_SIZE)
- .addComponent(colorBox, GroupLayout.PREFERRED_SIZE, 102, GroupLayout.PREFERRED_SIZE)
- .addComponent(statBox, GroupLayout.PREFERRED_SIZE, 102, GroupLayout.PREFERRED_SIZE)))
- .addGroup(gl_panel_1.createSequentialGroup()
- .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING)
- .addComponent(featherBox, GroupLayout.PREFERRED_SIZE, 107, GroupLayout.PREFERRED_SIZE)
- .addComponent(waitBox))
- .addPreferredGap(ComponentPlacement.UNRELATED)
- .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING)
- .addComponent(arrowBox, GroupLayout.PREFERRED_SIZE, 103, GroupLayout.PREFERRED_SIZE)
- .addComponent(paintBox, GroupLayout.DEFAULT_SIZE, 134, Short.MAX_VALUE))))
- .addContainerGap())
- );
- gl_panel_1.setVerticalGroup(
- gl_panel_1.createParallelGroup(Alignment.LEADING)
- .addGroup(gl_panel_1.createSequentialGroup()
- .addGap(17)
- .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
- .addComponent(waitBox)
- .addComponent(arrowBox))
- .addGap(18)
- .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
- .addComponent(featherBox)
- .addComponent(paintBox))
- .addGap(18)
- .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
- .addComponent(antibanBox)
- .addComponent(settingBox))
- .addGap(22)
- .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
- .addComponent(lblStatUsing)
- .addComponent(statBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
- .addGap(18)
- .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
- .addComponent(lblLocation)
- .addComponent(locationBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
- .addGap(18)
- .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
- .addComponent(lblPaintColor)
- .addComponent(colorBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
- .addContainerGap())
- );
- panel_1.setLayout(gl_panel_1);
- tabbedPane.addTab("Breaks", null, panel_2, null);
- breakBox.setText("Use Custom Breaks");
- breakBox.setForeground(Color.BLACK);
- breakBox.setFont(new Font("Cambria Math", Font.PLAIN, 12));
- breakBox.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- breakBoxActionPerformed(e);
- }
- });
- lblTimeBetweenBreaks.setText("Time Between Breaks:");
- lblTimeBetweenBreaks.setForeground(Color.BLACK);
- lblTimeBetweenBreaks.setFont(new Font("Cambria Math", Font.PLAIN, 13));
- lblBreakLengths.setText("Break Lengths:");
- lblBreakLengths.setForeground(Color.BLACK);
- lblBreakLengths.setFont(new Font("Cambria Math", Font.PLAIN, 13));
- randomBox.setText("Random Breaks");
- randomBox.setForeground(Color.BLACK);
- randomBox.setFont(new Font("Cambria Math", Font.PLAIN, 12));
- randomBox.setEnabled(false);
- randomBox.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- randomBoxActionPerformed(e);
- }
- });
- minTimeBeBox.setForeground(Color.BLACK);
- minTimeBeBox.setText("60");
- minTimeBeBox.setFont(new Font("Cambria Math", Font.PLAIN, 13));
- minTimeBeBox.setEnabled(false);
- lblTo.setText("to");
- lblTo.setForeground(Color.GRAY);
- lblTo.setFont(new Font("Cambria Math", Font.PLAIN, 13));
- maxTimeBeBox.setText("90");
- maxTimeBeBox.setForeground(Color.BLACK);
- maxTimeBeBox.setFont(new Font("Cambria Math", Font.PLAIN, 13));
- maxTimeBeBox.setEnabled(false);
- lblMins.setText("mins");
- lblMins.setForeground(Color.GRAY);
- lblMins.setFont(new Font("Cambria Math", Font.PLAIN, 13));
- label_3.setText("mins");
- label_3.setForeground(Color.GRAY);
- label_3.setFont(new Font("Cambria Math", Font.PLAIN, 13));
- minBreakBox.setText("15");
- minBreakBox.setForeground(Color.BLACK);
- minBreakBox.setFont(new Font("Cambria Math", Font.PLAIN, 13));
- minBreakBox.setEnabled(false);
- label_4.setText("mins");
- label_4.setForeground(Color.GRAY);
- label_4.setFont(new Font("Cambria Math", Font.PLAIN, 13));
- label_5.setText("to");
- label_5.setForeground(Color.GRAY);
- label_5.setFont(new Font("Cambria Math", Font.PLAIN, 13));
- maxBreakBox.setText("90");
- maxBreakBox.setForeground(Color.BLACK);
- maxBreakBox.setFont(new Font("Cambria Math", Font.PLAIN, 13));
- maxBreakBox.setEnabled(false);
- label_6.setText("mins");
- label_6.setForeground(Color.GRAY);
- label_6.setFont(new Font("Cambria Math", Font.PLAIN, 13));
- GroupLayout gl_panel_4 = new GroupLayout(panel_4);
- gl_panel_4.setHorizontalGroup(
- gl_panel_4.createParallelGroup(Alignment.LEADING)
- .addGroup(gl_panel_4.createSequentialGroup()
- .addContainerGap()
- .addGroup(gl_panel_4.createParallelGroup(Alignment.LEADING)
- .addGroup(gl_panel_4.createSequentialGroup()
- .addComponent(breakBox)
- .addGap(18)
- .addComponent(randomBox, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addGap(26))
- .addGroup(gl_panel_4.createSequentialGroup()
- .addComponent(lblTimeBetweenBreaks, GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE)
- .addGap(148))
- .addGroup(Alignment.TRAILING, gl_panel_4.createSequentialGroup()
- .addGroup(gl_panel_4.createParallelGroup(Alignment.TRAILING)
- .addGroup(gl_panel_4.createSequentialGroup()
- .addGap(10)
- .addComponent(minTimeBeBox, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(ComponentPlacement.RELATED)
- .addComponent(lblMins, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE)
- .addGap(26)
- .addComponent(lblTo)
- .addPreferredGap(ComponentPlacement.RELATED, 25, Short.MAX_VALUE)
- .addComponent(maxTimeBeBox, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(ComponentPlacement.RELATED)
- .addComponent(label_3, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE))
- .addGroup(Alignment.LEADING, gl_panel_4.createSequentialGroup()
- .addGap(10)
- .addComponent(minBreakBox, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(ComponentPlacement.RELATED)
- .addComponent(label_4, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE)
- .addGap(29)
- .addComponent(label_5, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(ComponentPlacement.RELATED, 22, Short.MAX_VALUE)
- .addComponent(maxBreakBox, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(ComponentPlacement.RELATED)
- .addComponent(label_6, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE))
- .addComponent(lblBreakLengths, GroupLayout.DEFAULT_SIZE, 212, Short.MAX_VALUE))
- .addGap(60))))
- );
- gl_panel_4.setVerticalGroup(
- gl_panel_4.createParallelGroup(Alignment.LEADING)
- .addGroup(gl_panel_4.createSequentialGroup()
- .addGap(17)
- .addGroup(gl_panel_4.createParallelGroup(Alignment.BASELINE)
- .addComponent(breakBox)
- .addComponent(randomBox))
- .addGap(18)
- .addComponent(lblTimeBetweenBreaks, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
- .addGap(5)
- .addGroup(gl_panel_4.createParallelGroup(Alignment.BASELINE)
- .addComponent(minTimeBeBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(lblMins, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
- .addComponent(lblTo)
- .addComponent(maxTimeBeBox, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
- .addComponent(label_3, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE))
- .addGap(18)
- .addComponent(lblBreakLengths, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(ComponentPlacement.RELATED)
- .addGroup(gl_panel_4.createParallelGroup(Alignment.BASELINE)
- .addComponent(minBreakBox, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
- .addComponent(label_4, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
- .addComponent(label_5, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
- .addComponent(maxBreakBox, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
- .addComponent(label_6, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE))
- .addContainerGap(47, Short.MAX_VALUE))
- );
- panel_4.setLayout(gl_panel_4);
- GroupLayout gl_panel_2 = new GroupLayout(panel_2);
- gl_panel_2.setHorizontalGroup(
- gl_panel_2.createParallelGroup(Alignment.LEADING)
- .addGroup(gl_panel_2.createSequentialGroup()
- .addComponent(panel_4, GroupLayout.PREFERRED_SIZE, 282, GroupLayout.PREFERRED_SIZE)
- .addContainerGap(34, Short.MAX_VALUE))
- );
- gl_panel_2.setVerticalGroup(
- gl_panel_2.createParallelGroup(Alignment.LEADING)
- .addComponent(panel_4, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- );
- panel_2.setLayout(gl_panel_2);
- submit.setText("Start");
- submit.setFont(new Font("Cambria Math", Font.BOLD, 12));
- submit.setBounds(108, 344, 89, 23);
- contentPane.add(submit);
- submit.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- submitActionPerformed(e);
- }
- });
- // LOAD SAVED SELECTION INFO
- try {
- log("WTF GO");
- String filename = GlobalConfiguration.Paths.getSettingsDirectory() + "\\AaimistersCKillerSettings.txt";
- Scanner in = new Scanner(new BufferedReader(new FileReader(filename)));
- log("WTF GO2");
- String line;
- String[] opts = {};
- while (in.hasNext()) {
- line = in.next();
- log("WTF GO3");
- if (line.contains(":")) {
- opts = line.split(":");
- }
- }
- log("WTF GO4");
- in.close();
- if (opts.length > 1) {
- log("loading...");
- if (opts[9].equals("true")) {
- log("1");
- if (opts[10].equals("false")) {
- log("2");
- maxTimeBeBox.setText(opts[11]);
- minTimeBeBox.setText(opts[12]);
- maxBreakBox.setText(opts[13]);
- minBreakBox.setText(opts[14]);
- }
- }
- log("3");
- locationBox.setSelectedIndex(Integer.parseInt(opts[1]));
- log("4");
- statBox.setSelectedIndex(Integer.parseInt(opts[2]));
- log("5");
- colorBox.setSelectedIndex(Integer.parseInt(opts[3]));
- log("6");
- if (opts[0].equals("true")) {
- settingBox.setSelected(true);
- } else {
- settingBox.setSelected(false);
- }
- if (opts[4].equals("true")) {
- antibanBox.setSelected(true);
- } else {
- antibanBox.setSelected(false);
- }
- if (opts[5].equals("true")) {
- waitBox.setSelected(true);
- } else {
- waitBox.setSelected(false);
- }
- if (opts[6].equals("true")) {
- featherBox.setSelected(true);
- } else {
- featherBox.setSelected(false);
- }
- if (opts[7].equals("true")) {
- arrowBox.setSelected(true);
- } else {
- arrowBox.setSelected(false);
- }
- if (opts[8].equals("true")) {
- paintBox.setSelected(true);
- } else {
- paintBox.setSelected(false);
- }
- if (opts[9].equals("true")) {
- breakBox.setSelected(true);
- } else {
- breakBox.setSelected(false);
- }
- if (opts[10].equals("true")) {
- randomBox.setSelected(true);
- } else {
- randomBox.setSelected(false);
- }
- }
- } catch (final Exception e2) {
- e2.printStackTrace();
- log.warning("Error loading settings.");
- }
- // END LOAD SAVED SELECTION INFO
- }
- private JFrame AaimistersGUI;
- private JPanel contentPane;
- private JCheckBox settingBox;
- private JComboBox locationBox;
- private JComboBox statBox;
- private JComboBox colorBox;
- private JCheckBox antibanBox;
- private JCheckBox waitBox;
- private JCheckBox featherBox;
- private JCheckBox arrowBox;
- private JCheckBox paintBox;
- private JCheckBox breakBox;
- private JCheckBox randomBox;
- private JTextArea maxTimeBeBox;
- private JTextArea minTimeBeBox;
- private JTextArea maxBreakBox;
- private JTextArea minBreakBox;
- private JPanel panel;
- private JPanel panel_1;
- private JPanel panel_2;
- private JPanel panel_4;
- private JLabel lblAaimistersEssenceMiner;
- private JLabel lblStatUsing;
- private JLabel lblLocation;
- private JLabel lblPaintColor;
- private JLabel lblTimeBetweenBreaks;
- private JLabel lblBreakLengths;
- private JLabel lblTo;
- private JLabel lblMins;
- private JLabel label_3;
- private JLabel label_4;
- private JLabel label_5;
- private JLabel label_6;
- private JTabbedPane tabbedPane;
- private JButton submit;
- }
- }