ULTIMATE GUIDE

LoG iN

Join the forum, it's quick and easy

ULTIMATE GUIDE

LoG iN

ULTIMATE GUIDE

Would you like to react to this message? Create an account in a few clicks or log in to continue.

ULTIMATE GUIDE


    IronMiner Mines and Drops Iron Flawless

    avatar
    Turk4life321
    Admin


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

    IronMiner Mines and Drops Iron Flawless Empty IronMiner Mines and Drops Iron Flawless

    Post  Turk4life321 Fri Jan 01, 2010 4:50 am

    import java.awt.Color;
    import java.awt.Graphics;
    import java.util.Map;

    import org.rsbot.event.events.ServerMessageEvent;
    import org.rsbot.event.listeners.PaintListener;
    import org.rsbot.event.listeners.ServerMessageListener;
    import org.rsbot.script.Constants;
    import org.rsbot.script.Script;
    import org.rsbot.script.ScriptManifest;
    import org.rsbot.script.Skills;
    import org.rsbot.script.wrappers.RSObject;

    @ScriptManifest(authors = { "PScriptMaker" }, category = "Mining", name = "Iron Power Miner", version = 1.02, description = "<html><body style='font-family: Arial; padding: 10px;'><color='yellow'><center><h2>Start near any iron rock. Have the pickaxe on your play or in inventory. Will drop the Hatchet/Pickaxe from the all fired up game (If you would give me the ID I would add it). Made by PScriptMaker. Version 1.02. Will edit it so keep eye on thread. Thanks to Fusion for the paint if want removed plz ask. Also thanks to the Java help chat for making me want to become a Public scripter.</h2></center></font></html>")
    public class IronMiner extends Script implements PaintListener, ServerMessageListener {

    int ironOre = 440;
    int[] ironRock = { 11954, 11956, 11955 };
    public boolean paint;
    public int miningAnimation = 626;
    public int energy = random(11, 70);
    int levelsGained = 0;
    int[] gemID = { 1617, 1619, 1621, 1623 };
    int[] pickaxe = { 1265, 1267, 1269, 1271, 1273, 1275, 1296 };


    public static final int MINING_STAT = Skills.getStatIndex("Mining");
    public long startTime = System.currentTimeMillis();
    int startLVL = skills.getCurrentSkillLevel(Constants.STAT_MINING);
    int nextLVL = skills.getXPToNextLevel(Constants.STAT_MINING);


    public double getVersion() {
    return 1.02;
    }



    public int loop() {

    if(isInventoryFull()) {

    dropAllExcept(pickaxe);
    dropAllExcept(gemID);

    return 500;

    }


    RSObject iron = getNearestObjectByID(ironRock);

    if(iron == null) {

    return 500;

    }

    if (getMyPlayer().getAnimation() == -1) {atObject(iron, "Mine");} wait(random(500, 700));

    return 0;
    }


    public void onFinish() {
    log("Thank You for using PScriptMaker's Iron Power Miner");
    log("Levels Gained: " + levelsGained);
    }

    public boolean onStart(Map<String, String> args) {

    return true;
    }
    public void onRepaint(final Graphics g) {
    if (isLoggedIn()) {
    }
    final int barsize = 160;
    final int barheight = 15;
    final int percentage = skills
    .getPercentToNextLevel(Constants.STAT_MINING);
    final int transparancy = 160;
    final int xBar = 561;
    final int yBar = 387;
    long millis = System.currentTimeMillis() - startTime;
    final long hours = millis / (1000 * 60 * 60);
    millis -= hours * 1000 * 60 * 60;
    final long minutes = millis / (1000 * 60);
    millis -= minutes * 1000 * 60;
    final long seconds = millis / 1000;
    final int x = 561;
    final int y = 225;
    g.setColor(new Color(0, 0, 0, 175));
    g.fillRoundRect(555, 210, 175, 250, 10, 10);
    g.setColor(Color.black);
    g.drawString("PScriptMaker's IronMiner", x + 1, y + 1);
    g.setColor(Color.white);
    g.drawString("PScriptMaker's IronMiner", x, y);
    g.setColor(Color.green);
    g.drawString("Level: "
    + skills.getCurrentSkillLevel(Constants.STAT_MINING) + "", 561,
    255);
    g.drawString("Levels Gained: " + Integer.toString(levelsGained) + "",
    561, 295);
    g
    .drawString("EXP Till Next Level: "
    + skills.getXPToNextLevel(Constants.STAT_MINING) + "",
    561, 315);
    g.drawString("Percent Till Next Level: "
    + skills.getPercentToNextLevel(Constants.STAT_MINING) + "%",
    561, 365);
    g.drawString("Time Running:", 561, 335);
    g.drawString("" + hours + ":" + minutes + ":" + seconds + "", 561, 345);
    g.setColor(new Color(255, 0, 0, transparancy));
    g.fillRect(xBar, yBar, barsize, barheight);
    g.setColor(new Color(0, 255, 0, transparancy));
    g.fillRect(xBar, yBar, barsize / 100 * percentage, barheight);
    g.setColor(new Color(255, 255, 255, transparancy));
    g.drawRect(xBar, yBar, barsize, barheight);

    }



    @Override
    public void serverMessageRecieved(ServerMessageEvent e) {
    final String serverString = e.getMessage();
    if (serverString.contains("You've just advanced")) {
    levelsGained++;
    }
    if (serverString.contains("wishes to trade with you")) {
    sendText("No thanks I busy and will need more room in the inventory", true);
    // TODO Auto-generated method stub

    }

    }

    }

      Current date/time is Thu Mar 28, 2024 3:00 pm