ULTIMATE GUIDE

LoG iN

ULTIMATE GUIDE


    AIOProMiner

    Share

    Turk4life321
    Admin

    Posts : 41
    Join date : 2009-08-09
    Location : In Saims Room *cough*

    AIOProMiner

    Post  Turk4life321 on Fri Jan 01, 2010 4:49 am

    import java.awt.Color;
    import java.awt.Container;
    import java.awt.Graphics;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.Insets;
    import java.awt.Point;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.Map;

    import javax.swing.JButton;
    import javax.swing.JCheckBox;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JProgressBar;
    import javax.swing.JTextField;
    import javax.swing.WindowConstants;

    import org.rsbot.bot.Bot;
    import org.rsbot.event.events.ServerMessageEvent;
    import org.rsbot.event.listeners.PaintListener;
    import org.rsbot.event.listeners.ServerMessageListener;
    import org.rsbot.script.Calculations;
    import org.rsbot.script.Script;
    import org.rsbot.script.ScriptManifest;
    import org.rsbot.script.wrappers.RSCharacter;
    import org.rsbot.script.wrappers.RSNPC;
    import org.rsbot.script.wrappers.RSObject;
    import org.rsbot.script.wrappers.RSPlayer;
    import org.rsbot.script.wrappers.RSTile;

    @ScriptManifest(authors = { "Killa" }, category = "Mining", name = "AIOProMiner", version = 1.1, description = "<html><body style=\"background-color: #000000; color: #FFFFFF;"
    + "font-family: Arial; text-align: center;\">"
    + "<h2 style=\"margin-bottom: 0px;\">AIOProMiner v1.1</h2>"
    + "<strong>By Killa</strong><br /><br />"
    + "Start the script near the bank.<br />"
    + "<small>I hope you enjoy.</small>")
    public class AIOProMiner extends Script implements PaintListener,
    ServerMessageListener {
    // -------------Script Methods---------------

    String status = "Starting Up";
    String Location = "NONE";
    String Ver = "1.1";
    String minin = "NONE";

    boolean StartScript = false;

    RSTile path[];
    RSTile returnPath[];
    RSTile Last_Tile;
    RSTile ExtraPath[];
    RSTile nextLoc;
    RSTile bankTile;

    RSObject nextRock;
    RSObject next;

    int startEXP;
    int bankID;
    int mined = 0;

    boolean ess = false;

    AIOProMinerGUI QQ;

    private JProgressBar progressBar1= new JProgressBar(0, 100);
    private JProgressBar progressBar2 = new JProgressBar(0, 100);

    long startTime = System.currentTimeMillis();

    // --------- Item & Object IDs --------------
    int adamantite[] = new int[] { 1939, 11941, 32435, 32436, 11940, 31083,
    31084, 31085, 31083 };
    int iron[] = new int[] { 2093, 2093, 2092, 9717, 9719, 9717, 9718, 11956,
    11955, 11954, 37307, 37309, 31073, 31071, 31072 };
    int copper[] = new int[] { 11938, 11936, 11963, 11937, 9709, 9708, 9710,
    11960, 11962, 11961, 31080, 31082 };
    int coal[] = new int[] { 11930, 11931, 11932, 11930, 11963, 11964, 2096,
    2097, 14850, 14851, 14852, 32426, 32426, 31068, 31069, 31070, 31068 };
    int gold[] = new int[] { 37312, 37310, 9722, 9720, 15505, 15503, 11185,
    11184, 11183, 9720, 9722, 37313, 31065, 31066 };
    int silver[] = new int[] { 37305, 37304, 37306, 2311, 9714, 9716, 9713,
    11950, 11949, 11948, 11950 };
    int tin[] = new int[] { 11935, 11934, 11933, 11959, 11957, 11959, 11958,
    9714, 9716, 31079, 31077, 31078 };
    int mithril[] = new int[] { 11942, 11944, 11943, 32438, 32439, 31086, 31088 };
    int gems[] = new int[] { 11195, 11194, 11364 };
    int clay[] = new int[] { 711, 9713, 15503, 15504, 15505, 31062, 31063 };
    int granite[] = { 10947, 00000 };

    int ores[];

    int pickaxes[] = new int[] { 1271, 1265, 15259, 1267, 1273, 1275, 1269 };

    // ---------- Falador Tiles && Id's -----------
    RSTile FaladorMiningGuild[] = { new RSTile(3013, 3356),
    new RSTile(3013, 3363), new RSTile(3024, 3355),
    new RSTile(3032, 3341), new RSTile(3021, 3338) };
    RSTile rFaladorMiningGuild[] = reversePath(FaladorMiningGuild);
    int fLadder1 = 2113;
    int fLadder2 = 30941;

    // ----------- Mining Guild + Drawven mines ----------
    RSTile gTocoal[] = { new RSTile(3021, 9739), new RSTile(3030, 9737),
    new RSTile(3042, 9738) };
    RSTile gToBank[] = reversePath(gTocoal);
    RSTile toStairs[] = { new RSTile(3013, 3356), new RSTile(3024, 3362),
    new RSTile(3034, 3359), new RSTile(3046, 3360),
    new RSTile(3055, 3366), new RSTile(3059, 3373) };
    RSTile dToStairs[] = { new RSTile(3039, 9768), new RSTile(3049, 9770),
    new RSTile(3058, 9777) };

    // ------------- Varrock Tiles + Essenses ------
    RSTile toStore[] = { new RSTile(3253, 3421), new RSTile(3262, 3414),
    new RSTile(3253, 3400) };
    RSTile toEss[] = { new RSTile(2910, 4833), new RSTile(2903, 4841),
    new RSTile(2894, 4846) };
    RSTile toDigsite[] = { new RSTile(3253, 3421), new RSTile(3263, 3428),
    new RSTile(3276, 3428), new RSTile(3287, 3421),
    new RSTile(3290, 3410), new RSTile(3291, 3398),
    new RSTile(3292, 3384), new RSTile(3287, 3373),
    new RSTile(3285, 3365) };

    // -------------- Al Karid ----------------
    RSTile AtoMine[] = { new RSTile(3270, 3167), new RSTile(3278, 3179),
    new RSTile(3282, 3194), new RSTile(3287, 3209),
    new RSTile(3297, 3224), new RSTile(3296, 3239),
    new RSTile(3296, 3254), new RSTile(3296, 3267),
    new RSTile(3298, 3282), new RSTile(3298, 3296),
    new RSTile(3299, 3308) };


    public boolean onStart(final Map<String, String> args) {
    QQ = new AIOProMinerGUI();
    QQ.setVisible(true);
    startEXP = skills.getCurrentSkillExp(STAT_MINING);
    while (!StartScript) {
    setCameraAltitude(true);
    wait(20);
    }
    return true;
    }

    public RSPlayer getNearestPlayer() {
    int Dist = 20;
    RSPlayer closest = null;
    final int[] validPlayers = Bot.getClient().getRSPlayerIndexArray();
    final org.rsbot.accessors.RSPlayer[] players = Bot.getClient()
    .getRSPlayerArray();

    for (final int element : validPlayers) {
    if (players[element] == null) {
    continue;
    }
    final RSPlayer player = new RSPlayer(players[element]);
    try {
    final int distance = distanceTo(player);
    if (distance < Dist && !player.equals(getMyPlayer())) {
    Dist = distance;
    closest = player;
    }
    } catch (final Exception ignored) {
    }
    }
    return closest;
    }

    public RSObject nextRock(final int... ids) {
    RSObject cur = null;
    int dist = -1;
    for (int x = 0; x < 104; x++) {
    for (int y = 0; y < 104; y++) {
    final RSObject o = getObjectAt(x + Bot.getClient().getBaseX(),
    y + Bot.getClient().getBaseY());
    if (o != null) {
    for (final int id : ids) {
    if (o.getID() == id) {
    int distTmp = getRealDistanceTo(o.getLocation(),
    true);
    RSCharacter him = getNearestPlayer();
    if (distTmp != -1) {
    if (cur == null || distTmp < dist) {
    if (him == null
    || !Location.contains("Mining")) {
    dist = distTmp;
    cur = o;
    } else if (distanceBetween(him
    .getLocation(), o.getLocation()) > 1
    && Location.contains("Mining")) {
    dist = distTmp;
    cur = o;
    }
    }
    }
    break;
    }
    }
    }
    }
    }
    return cur;
    }

    public RSObject findNext(RSTile Current, final int... ids) {
    RSObject cur = null;
    int dist = -1;
    for (int x = 0; x < 104; x++) {
    for (int y = 0; y < 104; y++) {
    final RSObject o = getObjectAt(x + Bot.getClient().getBaseX(),
    y + Bot.getClient().getBaseY());
    if (o != null && Current != null) {
    for (final int id : ids) {
    if (o.getID() == id) {
    int distTmp = getRealDistanceTo(o.getLocation(),
    true);
    RSCharacter him = getNearestPlayer();
    if (distTmp != -1) {
    if (!o.getLocation().equals(Current)
    && (cur == null || distTmp < dist)) {
    if (him == null) {
    dist = distTmp;
    cur = o;
    } else if (distanceBetween(him
    .getLocation(), o.getLocation()) > 1
    && !o.getLocation().equals(Current)) {
    dist = distTmp;
    cur = o;
    }
    }
    }
    break;
    }
    }
    }
    }
    }
    return cur;
    }

    private void highlightTile(final Graphics g, final RSTile t,
    final Color outline) {
    final Point pn = Calculations.tileToScreen(t.getX(), t.getY(), 0, 0, 0);
    final Point px = Calculations.tileToScreen(t.getX() + 1, t.getY(), 0,
    0, 0);
    final Point py = Calculations.tileToScreen(t.getX(), t.getY() + 1, 0,
    0, 0);
    final Point pxy = Calculations.tileToScreen(t.getX() + 1, t.getY() + 1,
    0, 0, 0);
    if (py.x == -1 || pxy.x == -1 || px.x == -1 || pn.x == -1) {
    return;
    }
    g.setColor(outline);
    g.drawPolygon(new int[] { py.x, pxy.x, px.x, pn.x }, new int[] { py.y,
    pxy.y, px.y, pn.y }, 4);
    }

    public boolean myatTile(final RSTile tile) {
    try {
    final Point location = Calculations.tileToScreen(tile);
    if (location.x == -1 || location.y == -1) {
    return false;
    }
    moveMouse(location, 3, 3);
    clickMouse(true);
    } catch (final Exception e) {
    return false;
    }
    return true;
    }

    public boolean hooverMouse(final RSTile tile) {
    try {
    final Point location = Calculations.tileToScreen(tile);
    if (location.x == -1 || location.y == -1) {
    return false;
    }
    if (getMouseLocation().distance(location.getLocation()) < 4) {
    return false;
    }
    if (getMouseLocation() != location)
    moveMouse(location, 3, 3);
    } catch (final Exception e) {
    return false;
    }
    return true;
    }

    public void enableRun() {
    if (getEnergy() > random(60, 100) && getSetting(173) != 1)
    setRun(true);
    }

    public int loop() {
    if (status.equals("Starting Up")) {
    if (Location.equals("Mining Guild")) {
    path = FaladorMiningGuild;
    returnPath = rFaladorMiningGuild;
    Last_Tile = new RSTile(3021, 3338);
    bankID = 11758;
    ExtraPath = gTocoal;
    bankTile = new RSTile(3013, 3356);
    status = "Going to Mine";
    } else if (Location.equals("Dwarven Mine")) {
    path = toStairs;
    returnPath = reversePath(toStairs);
    Last_Tile = new RSTile(3061, 3374);
    bankTile = new RSTile(3013, 3356);
    bankID = 11758;
    fLadder2 = 30944;
    ExtraPath = reversePath(dToStairs);
    fLadder1 = 11715;
    status = "Going to Mine";
    } else if (Location.equals("Varrock") && ess) {
    path = toStore;
    bankID = 11402;
    returnPath = reversePath(toStore);
    bankTile = new RSTile(3253, 3421);
    Last_Tile = new RSTile(3253, 3400);
    status = "Going to Mine";
    } else if (Location.equals("Varrock") && !ess) {
    path = toDigsite;
    bankTile = new RSTile(3253, 3421);
    Last_Tile = new RSTile(3285, 3365);
    returnPath = reversePath(toDigsite);
    ExtraPath = toDigsite;
    bankID = 11402;
    status = "Going to Mine";
    } else if (Location.equals("Al Karid")) {
    path = AtoMine;
    bankTile = new RSTile(3270, 3167);
    Last_Tile = new RSTile(3299, 3308);
    returnPath = reversePath(AtoMine);
    bankID = 35647;
    status = "Going to Mine";
    }
    // add more here
    }

    if (status.equals("Going to Mine")) {
    if (distanceTo(Last_Tile) > 4) {
    walkPathMM(randomizePath(path, 2, 2));
    wait(random(500,1000));
    enableRun();
    } else if (tileOnScreen(Last_Tile) && distanceTo(Last_Tile) < 3) {
    if (Location.equals("Mining Guild")
    || Location.equals("Dwarven Mine") || ess) {
    status = "Doing Some Action";
    } else {
    status = "Mining";
    }
    }
    return random(700, 1000);
    }

    if (status.equals("Doing Some Action")) {
    RSObject ladder = findObject(fLadder1);
    RSObject ladder2 = findObject(fLadder2);
    if (tileOnScreen(Last_Tile) && ladder != null
    && !getMyPlayer().isMoving() && Location.contains("Mining")) {
    if (tileOnScreen(ladder.getLocation())) {
    setCameraRotation(280 + random(-5, 30));
    atObject(ladder, "Climb");
    wait(random(500, 1000));
    } else if (!tileOnScreen(Last_Tile)
    && !getMyPlayer().isMoving()) {
    walkTileMM(Last_Tile);
    }
    } else if (!tileOnScreen(Last_Tile) && ladder2 == null
    && Location.contains("Mining")) {
    status = "Going to Mine";
    } else if (ladder2 != null && Location.equals("Mining Guild")) {
    status = "Mining";
    } else if (Location.contains("Mine") && ladder == null
    && ladder2 == null) {
    walkTileMM(new RSTile(3049, 9770));
    status = "Mining";
    } else if (Location.contains("Mine")) {
    if (ladder == null && !canReach(new RSTile(3061, 3377), false)) {
    setCompass('N');
    atTile(new RSTile(3061, 3375), "Open");
    wait(random(1000,2000));
    walkTileMM(new RSTile(3061, 3377));
    } else if (ladder!=null) {
    setCompass('N');
    atTile(new RSTile(3060, 3375), "Climb-down");
    wait(random(500, 1000));
    }
    } else if (ess) {
    RSNPC SomeNPC = getNearestNPCByID(553);
    RSObject wall = getNearestObjectByID(1440);
    if (SomeNPC != null) {
    if (SomeNPC.isOnScreen()) {
    atNPC(SomeNPC, "Teleport");
    wait(random(750, 1000));
    } else if (!SomeNPC.isOnScreen()) {
    walkTileMM(SomeNPC.getLocation());
    wait(random(500, 1000));
    }
    } else if (SomeNPC == null && wall != null) {
    status = "Mining";
    }

    }
    return random(700, 1000);
    }

    if (status.equals("Mining")) {
    if (!ess)
    nextRock = nextRock(ores);
    if (nextRock == null && !ess) {
    walkPathMM(randomizePath(ExtraPath, 2, 2));
    } else if (nextRock != null && !getMyPlayer().isMoving()
    && !isInventoryFull()) {
    if (tileOnScreen(nextRock.getLocation())
    && getMyPlayer().getAnimation() != 624) {
    myatTile(nextRock.getLocation());
    wait(random(250, 500));
    } else if (!getMyPlayer().isMoving()
    && !tileOnScreen(nextRock.getLocation())) {
    walkTileMM(nextRock.getLocation());
    }
    next = findNext(nextRock.getLocation(), ores);
    if (getMyPlayer().getAnimation() == 624) {
    if (next != null) {
    hooverMouse(next.getLocation());
    }
    }
    } else if (isInventoryFull()) {
    if (Location.contains("Mining") || Location.contains("Mine")
    || ess) {
    status = "Going to Bank";
    } else {
    status = "Walking to Bank";
    }
    } else if (ess && !isInventoryFull()) {
    RSObject ESS = findObject(2491);
    if (tileOnScreen(new RSTile(2910, 4833))) {
    walkPathMM(toEss, 1, 1);
    } else if (!tileOnScreen(new RSTile(2910, 4833)) && ESS != null
    && getMyPlayer().getAnimation() != 6752) {
    setCameraRotation(187 + random(10, 30));
    atTile(ESS.getLocation(), "Mine");
    }
    }

    return (random(700, 1000));
    }

    if (status.equals("Going to Bank")) {
    RSObject ladder2 = findObject(fLadder2);
    RSNPC miningGuy = getNearestNPCByID(3295);
    if (miningGuy == null && Location.equals("Mining Guild")) {
    if (ladder2 != null) {
    if (!tileOnScreen(ladder2.getLocation())) {
    walkPathMM(gToBank, 2, 2);
    setCameraRotation(280 + random(-5, 30));
    } else if (tileOnScreen(ladder2.getLocation())) {
    atObject(ladder2, "Climb");
    wait(random(500, 1000));
    }
    } else if (ladder2 == null && miningGuy == null) {
    walkPathMM(gToBank, 2, 2);
    }
    } else if (ladder2 == null && miningGuy != null
    && Location.equals("Mining Guild")) {
    status = "Walking to Bank";
    }
    if (Location.contains("Mine")) {
    if (tileOnMap(new RSTile(3049, 9770))
    && distanceTo(new RSTile(3058, 9777)) > 4) {
    walkPathMM(dToStairs);
    } else if (distanceTo(new RSTile(3058, 9777)) < 4) {
    atTile(new RSTile(3059, 9777), "Climb");
    wait(random(500, 1000));
    } else if (tileOnScreen(Last_Tile)) {
    status = "Walking to Bank";
    }
    } else if (ess) {
    RSNPC SomeNPC = getNearestNPCByID(553);
    RSObject Portal = getNearestObjectByID(2492);
    if (Portal != null) {
    if (distanceTo(Portal.getLocation()) > 3
    && !getMyPlayer().isMoving()) {
    walkTileMM(Portal.getLocation());
    wait(random(750, 1000));
    } else if (Portal.getLocation().getScreenLocation() != null) {
    atTile(Portal.getLocation(), "Enter");
    wait(random(1000, 2000));
    }
    } else if (Portal == null && SomeNPC != null) {
    status = "Walking to Bank";
    }
    }
    return random(700, 1000);
    }

    if (status.equals("Walking to Bank")) {
    RSObject ThisObject = findObject(11715);
    if (ThisObject == null && Last_Tile.getScreenLocation() != null && Location.contains("Mine")) {
    setCompass('s');
    atTile(Last_Tile, "Open");
    }else
    if (!tileOnScreen(bankTile)) {
    walkPathMM(returnPath, 2, 2);
    } else if (tileOnScreen(bankTile)) {
    status = "Banking";
    }
    return random(700, 1000);
    }

    if (status.equals("Banking")) {
    RSObject banks = findObject(bankID);
    if (banks != null && !bank.isOpen() && !getMyPlayer().isMoving()) {
    if (tileOnScreen(banks.getLocation())) {
    atObject(banks, "Use-quickly");
    } else if (!tileOnScreen(banks.getLocation())) {
    walkTileMM(banks.getLocation());
    }
    } else if (bank.isOpen()) {
    status = "Depositing";
    }
    return random(700, 1000);
    }

    if (status.equals("Depositing")) {
    if (bank.isOpen()) {
    if (getInventoryCount() > 2) {
    bank.depositAllExcept(pickaxes);
    } else if (getInventoryCount() < 2) {
    status = "Going to Mine";
    }
    } else if (inventoryContainsOneOf(ores) && !bank.isOpen()) {
    status = "Banking";
    }
    return random(700, 1000);
    }

    return random(500, 1000);
    }

    int Goal = 0;
    boolean log = false;
    public void onFinish() {
    if(guiUpdate != null) {
    guiUpdate.stopTime = true;
    }
    }
    private JLabel OresMined;
    private JLabel TimeRunning;
    private JLabel EXPGained;


    private UpdateThread guiUpdate = null;

    private class UpdateThread extends Thread {

    public boolean stopTime = false;

    public void run() {
    while(!stopTime) {
    progressBar1.setValue(Math.min(100,
    (int) ((((double) mined) / ((double) Goal)) * 100.0)));
    progressBar2.setValue(skills.getPercentToNextLevel(STAT_MINING));
    try {
    Thread.sleep(100);
    } catch(InterruptedException ignored) {

    }
    }
    }
    }
    public void onRepaint(Graphics g) {
    long millis = System.currentTimeMillis() - startTime;
    long hours = millis / (1000 * 60 * 60);
    millis -= hours * (1000 * 60 * 60);
    long minutes = millis / (1000 * 60);
    millis -= minutes * (1000 * 60);
    long seconds = millis / 1000;

    if (status.equals("Mining") && nextRock != null) {
    highlightTile(g, nextRock.getLocation(),
    new Color(27, 37, 171, 255));
    }
    if (TimeRunning != null) {
    TimeRunning.setText("" + hours + "h " + minutes + "m " + seconds + "s");
    OresMined.setText(""+mined);
    EXPGained.setText(""+(skills.getCurrentSkillExp(STAT_MINING) - startEXP));

    }
    if (status.equals("Mining") && next != null) {
    highlightTile(g, next.getLocation(), new Color(39, 231, 18, 255));
    }
    if (Goal != 0 && guiUpdate == null &&
    progressBar1 != null && startEXP != 0 && progressBar2 != null) {
    guiUpdate = new UpdateThread();
    guiUpdate.start();
    }
    if (getCurrentTab() == TAB_INVENTORY) {
    int[] coords = new int[] { 225, 240, 255, 270, 285, 300, 315, 330,
    345, 360, 375, 390, 405, 420, 435, 450 };
    g.setColor(new Color(12, 35, 248, 100));
    g.fillRoundRect(555, 210, 175, 250, 10, 10);
    g.setColor(Color.WHITE);

    g.drawString(" AIOProMiner v" + Ver + " By Killa", 561, coords[0]);
    g.drawString("status = " + status, 561, coords[2]);
    g.drawString("Mining = " + "Coming soon.", 561, coords[3]);
    g.drawString("Amount of Exp Gained = "
    + (skills.getCurrentSkillExp(STAT_MINING) - startEXP), 561,
    coords[4]);
    g.drawString("Total ores mined = " + mined, 561, coords[5]);
    g.drawString("Run Time = " + hours + "h " + minutes + "m "
    + seconds + "s", 561, coords[6]);
    g.drawString("-----Monitoring Information-----", 561, coords[8]);
    g.drawString("Location:" + Location, 561, coords[11]);
    }

    }

    public void serverMessageRecieved(ServerMessageEvent e) {
    String r = e.getMessage();
    if (r.contains("manage to mine")) {
    mined++;
    }

    }
    AIOProMinerProgress CC;
    public class AIOProMinerGUI extends JFrame {
    public AIOProMinerGUI() {
    initComponents();
    }
    private void OpenGUIPerformed(ActionEvent e) {
    CC = new AIOProMinerProgress();
    CC.setVisible(true);
    }

    private void StartActionPerformed(ActionEvent e) {
    Location = Locations.getSelectedItem().toString();

    if (Coal.isSelected()) {
    addOres(coal);
    }

    if (Mithrill.isSelected()) {
    addOres(mithril);
    }

    if (Adamantite.isSelected()) {
    addOres(adamantite);
    }

    if (Iron.isSelected()) {
    addOres(iron);
    }

    if (Tin.isSelected()) {
    addOres(tin);
    }

    if (Copper.isSelected()) {
    addOres(copper);
    }

    if (Silver.isSelected()) {
    addOres(silver);
    }

    if (Clay.isSelected()) {
    addOres(clay);
    }

    if (Gems.isSelected()) {
    addOres(gems);
    }

    if (Granite.isSelected()) {
    addOres(granite);
    }
    if (Essence.isSelected()) {
    ess = true;
    }

    StartScript = true;

    setVisible(false);
    }

    private void addOres(int[] oreArray) {
    if (ores == null)
    ores = oreArray;
    else {
    int[] temp = new int[oreArray.length + ores.length];
    int i;
    for (i = 0; i < oreArray.length; i++)
    temp[i] = oreArray[i];
    for (; i < oreArray.length + ores.length; i++)
    temp[i] = ores[i - oreArray.length];
    ores = temp;
    }
    }

    private void CancelActionPerformed(ActionEvent e) {
    setVisible(false);
    }

    private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY
    // //GEN-BEGIN:initComponents
    label1 = new JLabel();
    Adamantite = new JCheckBox();
    Gold = new JCheckBox();
    Coal = new JCheckBox();
    Mithrill = new JCheckBox();
    Iron = new JCheckBox();
    Tin = new JCheckBox();
    Copper = new JCheckBox();
    Granite = new JCheckBox();
    Essence = new JCheckBox();
    Clay = new JCheckBox();
    Gems = new JCheckBox();
    Silver = new JCheckBox();
    label3 = new JLabel();
    Locations = new JComboBox();
    label2 = new JLabel();
    OpenGUI = new JButton();
    Start = new JButton();
    Cancel = new JButton();

    // ======== this ========
    setTitle("AIOProMiner");
    setAlwaysOnTop(true);
    setResizable(false);
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    Container contentPane = getContentPane();
    contentPane.setLayout(new GridBagLayout());
    ((GridBagLayout) contentPane.getLayout()).columnWidths = new int[] {
    0, 0, 21, 0, 0 };

    // ---- label1 ----
    label1.setText("Types of Ores:");
    contentPane.add(label1, new GridBagConstraints(0, 0, 3, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 5), 0, 0));

    // ---- Adamantite ----
    Adamantite.setText("Adamantite");
    contentPane.add(Adamantite, new GridBagConstraints(1, 1, 1, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 5), 0, 0));

    // ---- Gold ----
    Gold.setText("Gold");
    contentPane.add(Gold, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0,
    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 5), 0, 0));

    // ---- Coal ----
    Coal.setText("Coal");
    contentPane.add(Coal, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0,
    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 5), 0, 0));

    // ---- Mithrill ----
    Mithrill.setText("Mithrill");
    contentPane.add(Mithrill, new GridBagConstraints(3, 2, 1, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 5), 0, 0));

    // ---- Iron ----
    Iron.setText("Iron");
    contentPane.add(Iron, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0,
    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 5), 0, 0));

    // ---- Tin ----
    Tin.setText("Tin");
    contentPane.add(Tin, new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0,
    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 5), 0, 0));

    // ---- Copper ----
    Copper.setText("Copper");
    contentPane.add(Copper, new GridBagConstraints(1, 4, 1, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 5), 0, 0));

    // ---- Granite ----
    Granite.setText("Granite");
    contentPane.add(Granite, new GridBagConstraints(3, 4, 1, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 5), 0, 0));

    // ---- Essence ----
    Essence.setText("Essence");
    contentPane.add(Essence, new GridBagConstraints(1, 5, 1, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 5), 0, 0));

    // ---- Clay ----
    Clay.setText("Clay");
    contentPane.add(Clay, new GridBagConstraints(3, 5, 1, 1, 0.0, 0.0,
    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 5), 0, 0));

    // ---- Gems ----
    Gems.setText("Gems");
    contentPane.add(Gems, new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0,
    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 5), 0, 0));

    // ---- Silver ----
    Silver.setText("Silver");
    contentPane.add(Silver, new GridBagConstraints(3, 6, 1, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 5), 0, 0));

    // ---- label3 ----
    label3.setText("Locations:");
    contentPane.add(label3, new GridBagConstraints(0, 7, 2, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 5), 0, 0));

    // ---- Locations ----
    Locations.setModel(new javax.swing.DefaultComboBoxModel(
    new String[] { "Mining Guild", "Shilo Village", "Al Karid",
    "Varrock", "Crafting Guild", "Dwarven Mine" }));
    contentPane.add(Locations, new GridBagConstraints(2, 7, 3, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 0), 0, 0));

    // ---- label2 ----
    label2.setText("GUI Progress Monitor:");
    contentPane.add(label2, new GridBagConstraints(0, 9, 3, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 5), 0, 0));

    // ---- OpenGUI ----
    OpenGUI.setText("Open GUI");
    OpenGUI.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    OpenGUIPerformed(e);
    }
    });
    contentPane.add(OpenGUI, new GridBagConstraints(3, 9, 2, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 0), 0, 0));

    // ---- Start ----
    Start.setText("Start Script");
    Start.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    StartActionPerformed(e);
    }
    });
    contentPane.add(Start, new GridBagConstraints(0, 10, 2, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 0, 5), 0, 0));

    // ---- Cancel ----
    Cancel.setText("Cancel");
    Cancel.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    CancelActionPerformed(e);
    }
    });
    contentPane.add(Cancel, new GridBagConstraints(2, 10, 3, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 0, 0), 0, 0));
    setSize(235, 340);
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization
    // //GEN-END:initComponents
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY
    // //GEN-BEGIN:variables
    private JLabel label1;
    private JCheckBox Adamantite;
    private JCheckBox Gold;
    private JCheckBox Coal;
    private JCheckBox Mithrill;
    private JCheckBox Iron;
    private JCheckBox Tin;
    private JCheckBox Copper;
    private JCheckBox Granite;
    private JCheckBox Essence;
    private JCheckBox Clay;
    private JCheckBox Gems;
    private JCheckBox Silver;
    private JLabel label3;
    private JComboBox Locations;
    private JLabel label2;
    private JButton OpenGUI;
    private JButton Start;
    private JButton Cancel;
    // JFormDesigner - End of variables declaration //GEN-END:variables
    }

    public class AIOProMinerProgress extends JFrame {
    public AIOProMinerProgress() {
    initComponents();
    }

    private void GoalAmountActionPerformed(ActionEvent e) {
    if(!GoalAmount.getText().isEmpty()) {
    int NewGoalZeal = Integer.parseInt(GoalAmount.getText());
    if (NewGoalZeal != Goal) {
    Goal = NewGoalZeal;
    log("Goal Set: " + Goal);
    }
    }
    }

    private void LogOutActionPerformed(ActionEvent e) {
    log = true;
    }

    private void SetGoalActionPerformed(ActionEvent e) {
    GoalAmountActionPerformed(e);
    }

    private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY
    // //GEN-BEGIN:initComponents
    label3 = new JLabel();
    TimeRunning = new JLabel();
    label4 = new JLabel();
    EXPGained = new JLabel();
    label5 = new JLabel();
    OresMined = new JLabel();
    label1 = new JLabel();
    GoalAmount = new JTextField();
    SetGoal = new JButton();
    LogOut = new JCheckBox();
    label2 = new JLabel();

    // ======== this ========
    setAlwaysOnTop(true);
    setResizable(false);
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("AIOProMiner Monitor");
    Container contentPane = getContentPane();
    contentPane.setLayout(new GridBagLayout());

    // ---- label3 ----
    label3.setText("Time Running:");
    contentPane.add(label3, new GridBagConstraints(0, 0, 1, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 5), 0, 0));

    // ---- TimeRunning ----
    TimeRunning.setText("text");
    contentPane.add(TimeRunning, new GridBagConstraints(1, 0, 3, 1,
    0.0, 0.0, GridBagConstraints.CENTER,
    GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0));

    // ---- label4 ----
    label4.setText("EXP Gained:");
    contentPane.add(label4, new GridBagConstraints(0, 2, 1, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 5), 0, 0));

    // ---- EXPGained ----
    contentPane.add(EXPGained, new GridBagConstraints(1, 2, 3, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 0), 0, 0));

    // ---- label5 ----
    label5.setText("Ores Mined:");
    contentPane.add(label5, new GridBagConstraints(0, 4, 1, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 5), 0, 0));

    // ---- OresMined ----
    contentPane.add(OresMined, new GridBagConstraints(1, 4, 3, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 0), 0, 0));

    // ---- label1 ----
    label1.setText("Set a Goal Amount:");
    contentPane.add(label1, new GridBagConstraints(0, 6, 1, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 5), 0, 0));

    // ---- GoalAmount ----
    GoalAmount.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    GoalAmountActionPerformed(e);
    }
    });
    contentPane.add(GoalAmount, new GridBagConstraints(1, 6, 2, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 5), 0, 0));

    // ---- SetGoal ----
    SetGoal.setText("Set As Goal");
    SetGoal.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    SetGoalActionPerformed(e);
    }
    });
    contentPane.add(SetGoal, new GridBagConstraints(3, 6, 1, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 0), 0, 0));
    contentPane.add(progressBar1, new GridBagConstraints(0, 7, 4, 1,
    0.0, 0.0, GridBagConstraints.CENTER,
    GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0));

    // ---- LogOut ----
    LogOut.setText("Log out when Achieved");
    LogOut.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    LogOutActionPerformed(e);
    }
    });
    contentPane.add(LogOut, new GridBagConstraints(1, 8, 3, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 0), 0, 0));

    // ---- label2 ----
    label2.setText("Progress Till Level:");
    contentPane.add(label2, new GridBagConstraints(0, 9, 1, 1, 0.0,
    0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 5, 5), 0, 0));
    contentPane.add(progressBar2, new GridBagConstraints(0, 10, 4, 1,
    0.0, 0.0, GridBagConstraints.CENTER,
    GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    setSize(275, 335);
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization
    // //GEN-END:initComponents
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY
    // //GEN-BEGIN:variables
    private JLabel label3;
    private JLabel label4;
    private JLabel label5;
    private JLabel label1;
    private JTextField GoalAmount;
    private JButton SetGoal;
    private JCheckBox LogOut;
    private JLabel label2;
    // JFormDesigner - End of variables declaration //GEN-END:variables
    }

    }

      Current date/time is Sat Nov 18, 2017 3:06 pm