April 17, 201510 yr Version 0.2: Start pickaxe equipped Iron rocks North of Yanille Bank Source: package org.acinate.scripts.Mining; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.Area; @ScriptManifest(name="PortKMiner", author ="Acinate", info="Mines iron", version=0.1, logo="Mining") public class PortKhazardMiner extends Script { private State state = State.IDLE; private Area MINE = new Area(2627,3141,2627,3140); private Area BANK = new Area(2662,3162,2664,3160); private Area iR1 = new Area(2627,3142,2627,3142); private Area iR2 = new Area(2628,3141,2628,3141); private Area iR3 = new Area(2628,3140,2628,3140); private final int dB = 11747; private final int iR = 13711; public void onStart() {this.log("Script has begun!");} public int onLoop() throws InterruptedException { switch (state = getState()) { case CONTINUE: getDialogues().clickContinue(); case IDLE: onLost(); case MINE: log("MINE:"); Entity ironRock1 = getObjects().closest(iR1, iR); Entity ironRock2 = getObjects().closest(iR2, iR); Entity ironRock3 = getObjects().closest(iR3, iR); int cameraPitch = getCamera().getPitchAngle(); if (cameraPitch < 50) { getCamera().movePitch(80); } if (!getInventory().isFull()) { if (myPlayer().getInteracting() == null) { if (ironRock1 != null) { ironRock1.interact("Mine"); log("Mining 1"); sleep(random.nextInt(500) + -100); } else { ironRock2.interact("Mine"); log("Mining 2"); sleep(random.nextInt(500) + -100); } if (ironRock3 != null && ironRock1 == null && ironRock2 == null) { ironRock3.interact("Mine"); log("Mining 3"); sleep(random.nextInt(500) + -100); } } } else { getLocalWalker().walk(BANK,true); } break; case BANK: log("BANK:"); Entity depositBox = getObjects().closest(dB); if (!getInventory().isEmpty()) { if (!getDepositBox().isOpen() && depositBox != null) { depositBox.interact("Deposit"); getDepositBox().close(); } else { getDepositBox().depositAll(); } } else { getLocalWalker().walk(MINE,true); } } return random.nextInt(500) +- 100; } private State getState() { if (getDialogues().isPendingContinuation()) return state.CONTINUE; if (BANK.contains(myPlayer())) return state.BANK; if (MINE.contains(myPlayer())) return state.MINE; return State.IDLE; } public enum State{CONTINUE, IDLE, MINE, BANK} public void onLost() { log("onLost()"); if (getInventory().isFull() && !BANK.contains(myPlayer())) { getLocalWalker().walk(BANK,true); log("onLost(BANK)"); } if (!getInventory().isFull() && !MINE.contains(myPlayer())) { getLocalWalker().walk(MINE,true); log("onLost(MINE)"); } } public void onExit() { } } Need help with: -Trying to use .prioritized to mine rocks in order - != null detection seems not to work 100% with rocks Edited April 17, 201510 yr by Acinate
April 17, 201510 yr Im sure the script is good :3 , another script writer you help you out with those problems im sure