April 18, 201312 yr Can't find the error with this, log spams Error while executing Script! import org.osbot.script.Scriptimport org.osbot.script.ScriptManifest @ScriptManifest(name = "Iron Miner", author = "LifezHatred", version = 1.0D, info="Banks and mines iron")class IronMiner extends Script { def ironRockId = 2093 def emptyRockId = 452 def MineRock = null enum State { Mining, Looking, Idle, Droping, WalkingTo, WalkingFrom, Banking } def state = State.Looking int onLoop() { switch(state) { case State.Mining: return doMine() case State.Looking: return getRock() case State.Idle: return doIdle() case State.Droping: return dropOre() } return 600 } int doIdle() { return 600 } int dropOre() { return 600 } int doMine() { if(MineRock != null || mineRock.isInArea() || mineRock.exists()) { return 600 + gRandom(200,400) } else { state = State.Looking return 600 } } int getRock() { MineRock = closestObject(2093) if(distance(MineRock.getPosition() > 5)) { //will add idle state here if(gRandom(100) < 10) { return 1200 + gRandom(1000, (1000*120)) } return 600 + gRandom(1000,2000) } else { MineRock.interact("Mine") state = State.Mining return 600 } return 600 }} Edited April 18, 201312 yr by LifezHatred
April 18, 201312 yr goovy blah, I want java syntax! your missing a bunch of semicolos xDOn topic... I can't seem to spot an error... OddEdit: try to get rid of this: || mineRock.isInArea() Because i think thats the error...Edit again:also add a null check here: int getRock() { MineRock = closestObject(2093) if(MineRock != null && distance(MineRock.getPosition() > 5)) { //What happens if it can't find the rock ! //will add idle state here if(gRandom(100) < 10) { return 1200 + gRandom(1000, (1000*120)) } Edited April 18, 201312 yr by zeejfps