Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package scripts;
- import javafx.application.Application;
- import javax.swing.DefaultComboBoxModel;
- import javax.swing.JComboBox;
- import javax.swing.JLabel;
- import javax.swing.JOptionPane;
- import javax.swing.JPanel;
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.Image;
- import java.awt.Rectangle;
- import java.io.IOException;
- import java.net.URL;
- import java.util.ArrayList;
- import java.util.Random;
- import javax.imageio.ImageIO;
- import org.tribot.api.General;
- import org.tribot.api.input.Keyboard;
- import org.tribot.api.input.Mouse;
- import org.tribot.api.interfaces.Positionable;
- import org.tribot.api2007.Banking;
- import org.tribot.api2007.Equipment;
- import org.tribot.api2007.Game;
- import org.tribot.api2007.GameTab;
- import org.tribot.api2007.GameTab.TABS;
- import org.tribot.api2007.ChooseOption;
- import org.tribot.api2007.Interfaces;
- import org.tribot.api2007.Inventory;
- import org.tribot.api2007.Objects;
- import org.tribot.api2007.Player;
- import org.tribot.api2007.Walking;
- import org.tribot.api2007.WebWalking;
- import org.tribot.api2007.Skills.SKILLS;
- import org.tribot.api2007.types.RSInterface;
- import org.tribot.api2007.types.RSInterfaceChild;
- import org.tribot.api2007.types.RSItem;
- import org.tribot.api2007.types.RSObject;
- import org.tribot.api2007.types.RSTile;
- import org.tribot.script.Script;
- import org.tribot.script.ScriptManifest;
- import org.tribot.api.Timing;
- import org.tribot.api2007.Skills;
- import org.tribot.script.interfaces.MessageListening07;
- import org.tribot.script.interfaces.Painting;
- @ScriptManifest(authors = { "ITryNotToTroll" }, category = "Smithing", name = "Troll Smelter v2")
- public class TrollSmelter extends Script implements Painting, MessageListening07{
- State state;
- Bar bar;
- public static TrollSmelterGUI gui = new TrollSmelterGUI();
- //IDs
- private final int
- BAR_SELECT_INTERFACE_ID = 311,
- SMELTING_ANIMATION_ID = 899,
- BAR_SELECT_INTERFACE_BRONZE_ID = 4,
- BAR_SELECT_INTERFACE_IRON_ID = 6,
- BAR_SELECT_INTERFACE_SILVER_ID = 7,
- BAR_SELECT_INTERFACE_STEEL_ID = 8,
- BAR_SELECT_INTERFACE_GOLD_ID = 9,
- BAR_SELECT_INTERFACE_MITHRIL_ID = 10,
- BAR_SELECT_INTERFACE_ADAMANTITE_ID = 11,
- BAR_SELECT_INTERFACE_RUNITE_ID = 12,
- CANNONBALL_SELECT_INTERFACE_ID = 309,
- CANNONBALL_SELECT_INTERFACE_CHILD_ID = 7;
- //GUI Variables
- private static RSTile furnaceTile;
- private boolean usingForging = true;
- public static ArrayList<String> barArrayList = new ArrayList<String>();
- public static ArrayList<Integer> stoppingConditionList = new ArrayList<Integer>();
- //Paint Variables
- private int currentLevel;
- private long currentXP;
- private int barsMade = 0;
- //Paint Constants
- private final int START_LEVEL = Skills.getActualLevel(SKILLS.SMITHING);
- private final int START_XP = Skills.getXP(SKILLS.SMITHING);
- private final long START_TIME = System.currentTimeMillis();
- private final double VERSION = 2;
- //Script Variables
- private int randomInput = (int) Math.random() * 71 + 28;
- public static boolean running = false;
- private int actionsLoop = 0;
- private int lastAmountBarsMade = 0;
- private Rectangle hoverBox;
- //Enums
- enum State {
- USE_BANK,
- CLOSE_BANK,
- EQUIP_FORGING,
- WALK_TO_FURNACE,
- WALK_TO_BANK,
- USE_FURNACE,
- CLICK_BAR,
- OPEN_BANK,
- USE_FIRST_INTERFACE,
- USE_SECOND_INTERFACE,
- ANIMATING
- }
- enum Bar {
- BRONZE,
- IRON,
- STEEL,
- MITHRIL,
- ADAMANTITE,
- RUNITE,
- SILVER,
- GOLD,
- CANNONBALLS;
- }
- //Really? It runs!
- @Override
- public void run() {
- initialiseScript();
- for(;actionsLoop<barArrayList.size();actionsLoop++)
- {
- bar = setBar(barArrayList.get(actionsLoop));
- int barsToMake = stoppingConditionList.get(actionsLoop);
- lastAmountBarsMade = barsMade;
- while(barsMade - lastAmountBarsMade < barsToMake)
- {
- state = getState();
- switch(state)
- {
- case USE_BANK:
- useBank();
- break;
- case CLOSE_BANK:
- closeBank();
- break;
- case OPEN_BANK:
- openBank();
- break;
- case EQUIP_FORGING:
- equipForging();
- break;
- case WALK_TO_FURNACE:
- walkToFurnace();
- break;
- case WALK_TO_BANK:
- walkToBank();
- break;
- case USE_FURNACE:
- useFurnace();
- break;
- case USE_FIRST_INTERFACE:
- useFirstInterface();
- break;
- case USE_SECOND_INTERFACE:
- useSecondInterface();
- break;
- case CLICK_BAR:
- clickBar();
- break;
- case ANIMATING:
- animatingSleep();
- break;
- }
- sleep(20, 70);
- }
- }
- }
- //Get current state of script
- public State getState()
- {
- if(Banking.isInBank())
- {
- if(needToEquipForging())
- {
- if(Banking.isBankScreenOpen())
- {
- return State.CLOSE_BANK;
- }
- else
- {
- return State.EQUIP_FORGING;
- }
- }
- else
- {
- if(needToBank())
- {
- if(!Banking.isBankScreenOpen())
- {
- return State.OPEN_BANK;
- }
- else
- {
- return State.USE_BANK;
- }
- }
- else
- {
- return State.WALK_TO_FURNACE;
- }
- }
- }
- else
- {
- if(isInFurnace())
- {
- if(needToBank())
- {
- return State.WALK_TO_BANK;
- }
- else
- {
- if(isFirstInterfaceOpen())
- {
- return State.USE_FIRST_INTERFACE;
- }
- else
- {
- if(isSecondInterfaceOpen() && !isFirstInterfaceOpen())
- {
- return State.USE_SECOND_INTERFACE;
- }
- else
- {
- if(bar == Bar.CANNONBALLS)
- {
- if(Game.isUptext("Use Steel"))
- {
- return State.USE_FURNACE;
- }
- else
- {
- if(isAnimating())
- {
- return State.ANIMATING;
- }
- else
- {
- return State.CLICK_BAR;
- }
- }
- }
- else
- {
- if(isAnimating())
- {
- return State.ANIMATING;
- }
- else
- {
- return State.USE_FURNACE;
- }
- }
- }
- }
- }
- }
- else
- {
- return State.WALK_TO_BANK;
- }
- }
- }
- private void initialiseScript()
- {
- gui.setVisible(true);
- while(!running)
- {
- sleep(20, 50);
- }
- if(furnaceTile == null)
- {
- println("Please re-run then select a furnace tile");
- running = false;
- }
- else
- {
- if(barArrayList.size() == 0 || stoppingConditionList.size() == 0)
- {
- println("Please re-run then select items (and their amounts!) to smelt");
- running = false;
- }
- }
- }
- private Bar setBar(String string)
- {
- switch(string)
- {
- case "Bronze Bar":
- return Bar.BRONZE;
- case "Iron Bar":
- return Bar.IRON;
- case "Steel Bar":
- return Bar.STEEL;
- case "Mithril Bar":
- return Bar.MITHRIL;
- case "Adamantite Bar":
- return Bar.ADAMANTITE;
- case "Runite Bar":
- return Bar.RUNITE;
- case "Cannonballs":
- return Bar.CANNONBALLS;
- case "Gold Bar":
- return Bar.GOLD;
- case "Silver Bar":
- return Bar.SILVER;
- }
- return Bar.CANNONBALLS;
- }
- private boolean needToBank()
- {
- switch(bar)
- {
- case BRONZE:
- return Inventory.getCount("Tin ore") == 0 || Inventory.getCount("Copper ore") == 0;
- case IRON:
- return Inventory.getCount("Iron ore") == 0;
- case STEEL:
- return Inventory.getCount("Iron ore") == 0 || Inventory.getCount("Coal") < 2;
- case MITHRIL:
- return Inventory.getCount("Mithril ore") == 0 || Inventory.getCount("Coal") < 4;
- case ADAMANTITE:
- return Inventory.getCount("Adamantite ore") == 0 || Inventory.getCount("Coal") < 6;
- case RUNITE:
- return Inventory.getCount("Runite ore") == 0 || Inventory.getCount("Coal") < 8;
- case SILVER:
- return Inventory.getCount("Silver ore") == 0;
- case GOLD:
- return Inventory.getCount("Gold ore") == 0;
- case CANNONBALLS:
- return Inventory.getCount("Steel bar") ==0 || Inventory.getCount("Ammo mould") == 0;
- }
- return true;
- }
- private boolean needToEquipForging()
- {
- return Inventory.getCount("Ring of forging") > 0 && !Equipment.isEquipped("Ring of forging") && usingForging;
- }
- private boolean isInFurnace()
- {
- return Player.getPosition().distanceTo(furnaceTile) < 3;
- }
- private boolean isAnimating()
- {
- if(Player.getPosition().distanceTo(furnaceTile) < 5
- && (Inventory.getCount(barArrayList.get(actionsLoop)) >0
- || Inventory.isFull()))
- {
- long timeout = System.currentTimeMillis();
- while(timeout + 3000 > System.currentTimeMillis())
- {
- if(Player.getAnimation() != -1)
- {
- return true;
- }
- sleep(50, 100);
- }
- return false;
- }
- else
- {
- return false;
- }
- }
- private boolean isFirstInterfaceOpen()
- {
- RSInterface barSmeltInterface;
- switch(bar)
- {
- case BRONZE:
- case IRON:
- case STEEL:
- case MITHRIL:
- case ADAMANTITE:
- case RUNITE:
- case SILVER:
- case GOLD:
- barSmeltInterface = Interfaces.get(BAR_SELECT_INTERFACE_ID,BAR_SELECT_INTERFACE_BRONZE_ID);
- return barSmeltInterface != null && !barSmeltInterface.isHidden();
- case CANNONBALLS:
- barSmeltInterface = Interfaces.get(CANNONBALL_SELECT_INTERFACE_ID, CANNONBALL_SELECT_INTERFACE_CHILD_ID);
- return barSmeltInterface != null && !barSmeltInterface.isHidden();
- }
- return false;
- }
- private boolean isSecondInterfaceOpen()
- {
- return Interfaces.get(548, 119) != null && !Interfaces.get(548, 119).isHidden();
- }
- private void useBank()
- {
- long timeout;
- switch(bar)
- {
- case BRONZE:
- Banking.depositAll();
- Banking.withdraw(14, "Tin ore");
- timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && Inventory.getCount("Tin ore") == 0)
- {
- sleep(20, 70);
- }
- Banking.withdraw(14, "Copper ore");
- timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && Inventory.getCount("Copper ore") == 0)
- {
- sleep(20, 70);
- }
- break;
- case IRON:
- Banking.depositAll();
- if(usingForging && Inventory.getCount("Ring of forging") == 0 && !Equipment.isEquipped("Ring of forging"))
- {
- Banking.withdraw(1, "Ring of forging");
- timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && Inventory.getCount("Ring of forging") == 0)
- {
- sleep(20, 70);
- }
- }
- else
- {
- Banking.withdraw(0, "Iron ore");
- timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && Inventory.getCount("Iron ore") == 0)
- {
- sleep(20, 70);
- }
- }
- break;
- case STEEL:
- Banking.depositAll();
- Banking.withdraw(9, "Iron ore");
- timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && Inventory.getCount("Iron ore") == 0)
- {
- sleep(20, 70);
- }
- Banking.withdraw(0, "Coal");
- timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && Inventory.getCount("Coal") == 0)
- {
- sleep(20, 70);
- }
- break;
- case MITHRIL:
- Banking.depositAll();
- Banking.withdraw(5, "Mithril ore");
- timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && Inventory.getCount("Mithril ore") == 0)
- {
- sleep(20, 70);
- }
- Banking.withdraw(0, "Coal");
- timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && Inventory.getCount("Coal") == 0)
- {
- sleep(20, 70);
- }
- break;
- case ADAMANTITE:
- Banking.depositAll();
- Banking.withdraw(4, "Admantite ore");
- timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && Inventory.getCount("Adamantite ore") == 0)
- {
- sleep(20, 70);
- }
- Banking.withdraw(0, "Coal");
- timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && Inventory.getCount("Coal") == 0)
- {
- sleep(20, 70);
- }
- break;
- case RUNITE:
- Banking.depositAll();
- Banking.withdraw(3, "Runite ore");
- timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && Inventory.getCount("Runite ore") == 0)
- {
- sleep(20, 70);
- }
- Banking.withdraw(0, "Coal");
- timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && Inventory.getCount("Coal") == 0)
- {
- sleep(20, 70);
- }
- break;
- case SILVER:
- Banking.depositAll();
- Banking.withdraw(0, "Silver ore");
- timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && Inventory.getCount("Silver ore") == 0)
- {
- sleep(20, 70);
- }
- break;
- case GOLD:
- Banking.depositAll();
- Banking.withdraw(0, "Gold ore");
- timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && Inventory.getCount("Gold ore") == 0)
- {
- sleep(20, 70);
- }
- break;
- case CANNONBALLS:
- Banking.depositAllExcept("Ammo mould");
- if(Inventory.getCount("Ammo mould") == 0)
- {
- Banking.withdraw(1, "Ammo mould");
- timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && Inventory.getCount("Ammo mould") == 0)
- {
- sleep(20, 70);
- }
- }
- Banking.withdraw(0, "Steel bar");
- timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && Inventory.getCount("Steel bar") == 0)
- {
- sleep(20, 70);
- }
- break;
- }
- }
- private void closeBank()
- {
- Banking.close();
- long timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && Banking.isBankScreenOpen())
- {
- sleep(20, 70);
- }
- }
- private void openBank()
- {
- Banking.openBank();
- while(Player.isMoving())
- {
- sleep(20, 70);
- }
- long timeout = System.currentTimeMillis();
- while(timeout + 500 > System.currentTimeMillis()
- && !Banking.isBankScreenOpen())
- {
- sleep(20, 70);
- }
- }
- private void equipForging()
- {
- if(GameTab.getOpen() != TABS.INVENTORY)
- {
- Inventory.open();
- }
- RSItem[] forging = Inventory.find("Ring of forging");
- if(forging.length > 0 && forging[0] != null)
- {
- forging[0].click();
- long timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && Inventory.getCount("Ring of forging") > 0)
- {
- sleep(20, 70);
- }
- }
- }
- private void walkToFurnace()
- {
- if(Player.getPosition().distanceTo(new RSTile(3687, 3466)) < 10)
- {
- Walking.clickTileMM(new RSTile(3687, 3479), 1);
- }
- else
- {
- WebWalking.walkTo(furnaceTile);
- }
- while(Player.isMoving())
- {
- sleep(20, 70);
- }
- }
- private void walkToBank()
- {
- if(Player.getPosition().distanceTo(new RSTile(3687, 3479)) < 10)
- {
- Walking.clickTileMM(new RSTile(3687, 3466), 1);
- }
- else
- {
- WebWalking.walkToBank();
- }
- while(Player.isMoving())
- {
- sleep(20, 70);
- }
- }
- private void useFurnace()
- {
- RSObject[] furnace = Objects.find(10, "Furnace");
- if(furnace.length > 0 && furnace[0] != null)
- {
- if(bar == Bar.CANNONBALLS)
- {
- furnace[0].click(Game.getUptext() + " Furnace");
- }
- else
- {
- furnace[0].click("Smelt Furnace");
- if(hoverBox != null)
- {
- Random rand = new Random();
- int x = (int) (rand.nextInt((int) (hoverBox.getWidth() + 1)) + hoverBox.getX());
- rand = new Random();
- int y = (int) (rand.nextInt((int) (hoverBox.getHeight() + 1)) + hoverBox.getY());
- Mouse.move(x, y);
- }
- }
- }
- while(Player.isMoving())
- {
- sleep(50, 100);
- }
- long timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && !isFirstInterfaceOpen())
- {
- sleep(20, 70);
- }
- }
- private void useFirstInterface()
- {
- RSInterface smeltInterface;
- switch(bar)
- {
- case BRONZE:
- smeltInterface = Interfaces.get(BAR_SELECT_INTERFACE_ID, BAR_SELECT_INTERFACE_BRONZE_ID);
- if(smeltInterface != null)
- {
- if(Game.getUptext().contains("Smelt 1 Bronze"))
- {
- Mouse.click(3);
- chooseOption("Smelt X Bronze");
- }
- else
- {
- smeltInterface.click("Smelt X Bronze");
- }
- }
- hoverBox = smeltInterface.getAbsoluteBounds();
- break;
- case IRON:
- smeltInterface = Interfaces.get(BAR_SELECT_INTERFACE_ID, BAR_SELECT_INTERFACE_IRON_ID);
- if(smeltInterface != null)
- {
- if(Game.getUptext().contains("Smelt 1 Iron"))
- {
- Mouse.click(3);
- chooseOption("Smelt X Iron");
- }
- else
- {
- smeltInterface.click("Smelt X Iron");
- }
- }
- hoverBox = smeltInterface.getAbsoluteBounds();
- break;
- case STEEL:
- smeltInterface = Interfaces.get(BAR_SELECT_INTERFACE_ID, BAR_SELECT_INTERFACE_STEEL_ID);
- if(smeltInterface != null)
- {
- if(Game.getUptext().contains("Smelt 1 Steel"))
- {
- Mouse.click(3);
- chooseOption("Smelt 10 Steel");
- }
- else
- {
- smeltInterface.click("Smelt 10 Steel");
- }
- }
- hoverBox = smeltInterface.getAbsoluteBounds();
- break;
- case MITHRIL:
- smeltInterface = Interfaces.get(BAR_SELECT_INTERFACE_ID, BAR_SELECT_INTERFACE_MITHRIL_ID);
- if(smeltInterface != null)
- {
- if(Game.getUptext().contains("Smelt 1 Mithril"))
- {
- Mouse.click(3);
- chooseOption("Smelt 10 Mithril");
- }
- else
- {
- smeltInterface.click("Smelt 10 Mithril");
- }
- }
- hoverBox = smeltInterface.getAbsoluteBounds();
- break;
- case ADAMANTITE:
- smeltInterface = Interfaces.get(BAR_SELECT_INTERFACE_ID, BAR_SELECT_INTERFACE_ADAMANTITE_ID);
- if(smeltInterface != null)
- {
- if(Game.getUptext().contains("Smelt 1 Adamant"))
- {
- Mouse.click(3);
- chooseOption("Smelt 5 Adamant");
- }
- else
- {
- smeltInterface.click("Smelt 5 Adamant");
- }
- }
- hoverBox = smeltInterface.getAbsoluteBounds();
- break;
- case RUNITE:
- smeltInterface = Interfaces.get(BAR_SELECT_INTERFACE_ID, BAR_SELECT_INTERFACE_RUNITE_ID);
- if(smeltInterface != null)
- {
- if(Game.getUptext().contains("Smelt 1 Rune"))
- {
- Mouse.click(3);
- chooseOption("Smelt 5 Rune");
- }
- else
- {
- smeltInterface.click("Smelt 5 Rune");
- }
- }
- hoverBox = smeltInterface.getAbsoluteBounds();
- break;
- case SILVER:
- smeltInterface = Interfaces.get(BAR_SELECT_INTERFACE_ID, BAR_SELECT_INTERFACE_SILVER_ID);
- if(smeltInterface != null)
- {
- if(Game.getUptext().contains("Smelt 1 Silver"))
- {
- Mouse.click(3);
- chooseOption("Smelt X Silver");
- }
- else
- {
- smeltInterface.click("Smelt X Silver");
- }
- }
- hoverBox = smeltInterface.getAbsoluteBounds();
- break;
- case GOLD:
- smeltInterface = Interfaces.get(BAR_SELECT_INTERFACE_ID, BAR_SELECT_INTERFACE_GOLD_ID);
- if(smeltInterface != null)
- {
- if(Game.getUptext().contains("Smelt 1 Gold"))
- {
- Mouse.click(3);
- chooseOption("Smelt X Gold");
- }
- else
- {
- smeltInterface.click("Smelt X Gold");
- }
- }
- hoverBox = smeltInterface.getAbsoluteBounds();
- break;
- case CANNONBALLS:
- smeltInterface = Interfaces.get(CANNONBALL_SELECT_INTERFACE_ID, CANNONBALL_SELECT_INTERFACE_CHILD_ID);
- if(smeltInterface != null)
- {
- smeltInterface.click();
- }
- hoverBox = smeltInterface.getAbsoluteBounds();
- break;
- }
- long timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && isFirstInterfaceOpen())
- {
- sleep(20, 70);
- }
- }
- private void chooseOption(String option)
- {
- long timeout = System.currentTimeMillis();
- while(System.currentTimeMillis() - 2000 < timeout
- && !ChooseOption.isOpen())
- {
- sleep(50, 100);
- }
- Interfaces.closeAll();
- if(ChooseOption.isOpen())
- {
- if(ChooseOption.isOptionValid(option))
- {
- ChooseOption.select(option);
- return;
- }
- else
- {
- ChooseOption.close();
- }
- }
- }
- private void useSecondInterface()
- {
- Keyboard.typeSend("" + randomInput);
- long timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && (isSecondInterfaceOpen() || isFirstInterfaceOpen()))
- {
- sleep(20, 70);
- }
- }
- private void clickBar()
- {
- RSItem[] bar = Inventory.find("Steel bar");
- if(bar.length > 0 && bar[0] != null)
- {
- bar[0].click("Use");
- }
- long timeout = System.currentTimeMillis();
- while(timeout + 2000 > System.currentTimeMillis()
- && !Game.isUptext("Use Steel bar"))
- {
- sleep(20, 70);
- }
- }
- private void animatingSleep()
- {
- sleep(50, 100);
- }
- @Override
- public void onPaint(Graphics g) {
- currentXP = Skills.getXP(SKILLS.SMITHING);
- currentLevel = Skills.getActualLevel(SKILLS.SMITHING);
- long timeRan = System.currentTimeMillis() - START_TIME;
- long xpGained = currentXP - START_XP;
- double multiplier = timeRan / 3600000D;
- int xpPerHour = (int) (xpGained / multiplier);
- int barsPerHour = (int) (barsMade / multiplier);
- int levelsGained = currentLevel - START_LEVEL;
- g.setColor(Color.WHITE);
- g.drawString("ITryNotToTroll's Smither", 10, 70);
- g.drawString("Bar Being Smelted: " + bar, 10, 90);
- g.drawString("Running for: " + Timing.msToString(timeRan), 10, 110);
- g.drawString("Levels Gained: " + levelsGained, 10, 130);
- g.drawString("Xp gained: " + xpGained + " (" + xpPerHour + "/h)", 10,
- 150);
- g.drawString("Bars made: " + barsMade + " (" + barsPerHour + "/h)",
- 10, 170);
- g.drawString("State: " + state, 10, 190);
- g.drawString("Actions left", 10, 210);
- if(barArrayList.size() > 0)
- {
- g.drawString(barArrayList.get(0) + ", " + (stoppingConditionList.get(0) - (barsMade - lastAmountBarsMade)), 10, 230);
- for(int i = actionsLoop + 1;i<barArrayList.size();i++)
- {
- g.drawString(barArrayList.get(i) + ", " + stoppingConditionList.get(i), 10, 250 + (20* (i-actionsLoop)) );
- }
- }
- }
- public static boolean setFurnaceTile()
- {
- RSTile tempTile = Player.getPosition();
- if(tempTile != null)
- {
- furnaceTile = tempTile;
- return true;
- }
- return false;
- }
- @Override
- public void clanMessageReceived(String arg0, String arg1) {
- // TODO Auto-generated method stub
- }
- @Override
- public void duelRequestReceived(String arg0, String arg1) {
- // TODO Auto-generated method stub
- }
- @Override
- public void personalMessageReceived(String arg0, String arg1) {
- // TODO Auto-generated method stub
- }
- @Override
- public void playerMessageReceived(String arg0, String arg1) {
- // TODO Auto-generated method stub
- }
- @Override
- public void serverMessageReceived(String mes) {
- if (mes.contains("You retrieve")) {
- barsMade++;
- }
- if (mes.contains("You remove the cannonballs from the mould")) {
- barsMade++;
- }
- }
- @Override
- public void tradeRequestReceived(String arg0) {
- // TODO Auto-generated method stub
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement