Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
- //import com.sun.org.apache.xerces.internal.impl.xpath.XPath.LocationPath;// wtf?
- @ScriptManifest(authors = { "PScriptMaker" }, category = "Mining", name = "Iron Power Miner", version = 1.05, description = "<html><body>Start near any iron rock. Will drop every thing but Pickaxes. Version 1.05. Made by PScriptMaker. " +
- "<select name='location'>" +
- "<option>Bank" +
- "<option>PowerMine</body></html>")
- public class IronMiner extends Script implements PaintListener, ServerMessageListener {
- int ironOre = 440;
- int[] ironRock = { 2093, 2092, 9719, 9717, 9718, 11956,11955, 11954, 37307, 37308, 37309, 31072, 31073, 31071 };
- public boolean paint;
- public int miningAnimation = 626;
- public int energy = random(11, 70);
- int levelsGained = 0;
- public int startexp;
- int gem = 0;
- int exp = 0;
- int rocksMined = 0;
- int[] gemID = { 1617, 1619, 1621, 1623 };
- int[] pickaxe = { 1265, 1267, 1269, 1271, 1273, 1275, 1296, 13661 };
- 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 String Location;
- public double getVersion() {
- return 1.05;
- }
- public int loop() {
- if (Location.equals("PowerMine")) {
- if (isInventoryFull()) {
- if(isInventoryFull()) {
- dropAllExcept(pickaxe);
- return 500;
- }
- RSObject iron = getNearestObjectByID(ironRock);
- if(iron == null) {
- return 500;
- }
- if (getMyPlayer().getAnimation() == -1) {atObject(iron, "Mine");} wait(random(500, 700));
- return 0;
- // TODO Loop
- }
- public void onFinish() {
- log("Thank You for using PScriptMaker's Iron Power Miner");
- log("Levels Gained: " + levelsGained);
- log("Rocks Mined: " + rocksMined);
- }
- public boolean onStart(Map<String, String> args) {
- Location=args.get("location");
- return true;
- }
- public void onRepaint(Graphics g) {
- if (isLoggedIn()) {
- int xpGained = 0;
- if ( startexp == 0) {
- startexp = skills.getCurrentSkillExp(STAT_MINING);}
- 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;
- long minutes2 = minutes + (hours * 60);
- g.setColor(Color.green);
- g.drawString("PScriptMaker's Iron Power Miner" , 9, 315);
- g.drawString("Time running: " + hours + ":" + minutes + ":" + seconds + "", 9, 299);
- g.drawString("Rocks Mined: " + rocksMined, 9, 283);
- g.drawString("Levels Gained: " + levelsGained, 9, 267);
- g.drawString("Gems Found: " + gem, 9, 251);
- g.drawString("XP Gained: " + exp, 9, 235);
- }
- }
- @Override
- public void serverMessageRecieved(ServerMessageEvent e) {
- final String serverString = e.getMessage();
- if (serverString.contains("You've just advanced")) {
- levelsGained++;
- }
- if (serverString.contains("You manage to mine")) {
- rocksMined++;
- exp = exp + 35;
- }
- if (serverString.contains("you just found")) {
- gem++;
- exp = exp + 65;
- // TODO Server Messages
- }
- }
- }
Add Comment
Please, Sign In to add comment