import org.osbot.script.mouse.MouseDestinationimport org.osbot.script.rs2.map.Position@ScriptManifest(name = "SeersWillowChop", author = "Masamato", version = 1.2D, info="Start any where between Seers Bank and Willows.")class SeersWillowChop extends Script { int bankId = 25808 int[] treeIds = [1276, 1278] int[] axeIds = [1350, 1352, 1356, 1358, 1360, 1062] enum State { IDLE, CHOPPING, WALK_TO_BANK, PIN, BANKING, WALK_TO_WILLOWS } def state = State.IDLE def currentTree = null def bankTile = new Position(2723, 3493, 0) void onStart() { if (client.getInventory().isFull()) state = State.WALK_TO_BANK } int onLoop() { switch (state) { case State.IDLE: return onIdle() case State.CHOPPING: return onChopping() case State.WALK_TO_BANK: return walkToBank() case State.BANKING: return bank() case State.WALK_TO_WILLOWS: return walkToWillows() } return 300 + random(500) } int onIdle() { if (client.getInventory().isFull()) { state = State.WALK_TO_BANK //client.moveCameraToEntity(closestObject(bankId)) return 500 + gRandom(100, 400) } currentTree = closestObject(treeIds) if(currentTree != null) { log("Going to next Willow!") selectOption(currentTree, currentTree.getMouseDestination(), "Chop down", "Tree", true) client.moveCameraToEntity(currentTree) if (random(5) == 0) { client.moveCameraToEntity(currentTree) sleep(3000 + gRandom(500, 200)) } } return 100 + gRandom(600, 500); } int onChopping() { if (client.getInventory().isFull()) { state = State.WALK_TO_BANK //client.moveCameraToEntity(closestObject(bankId)) return 300 + gRandom(100, 400) } if (random(30) == 0 && currentTree != null && currentTree.exists()) client.moveCameraToEntity(currentTree) if (currentTree == null) { state = State.IDLE log("Chopped down Willow!") return 500 + gRandom(1000, 500) } if (!currentTree.exists()) { state = State.IDLE currentTree = null log("Chopped down Willow!") } return 500 + gRandom(100, 500) } int walkToBank() { log ("Walking to Bank!") walk(bankTile) sleep(5000 + gRandom(300, 50)) selectEntityOption(closestObject(bankId), "Bank", "Bank booth") if (myX() <= 2722 && myX() >= 2729 && myY() >= 3493 && myY() <= 3490) { selectEntityOption(closestObject(bankId), "Bank", "Bank booth") return 100 + gRandom(100, 200) } sleep(1000 + gRandom(300, 50)) if (client.getBank().isOpen()) state = State.BANKING return 200 + gRandom(100, 200) } int bank() { client.getBank().depositAllExcept(axeIds) client.getBank().close() state = State.WALK_TO_WILLOWS def tree = closestObject(treeIds) //if (tree != null) //client.moveCameraToEntity(tree) return 500 + gRandom(200, 300) } int walkToWillows() { log("Walking to Willow Trees") currentTree = closestObject(treeIds) if (currentTree != null) { log("Going to next Willow!") selectEntityOption(currentTree, "Chop down", "Tree") client.moveCameraToEntity(currentTree) } return 200 + gRandom(800, 300) sleep(8000 + gRandom(300, 50)) state = State.IDLE } void onMessage(String message) { if (message == "You swing your axe at the tree.") { log("Chopping down tree!") state = State.CHOPPING } else if (message == "You get some logs.") { state = State.IDLE } else if (message == "Your inventory is too full to hold any more logs.") { state = State.WALK_TO_BANK } } }
modified the script to work with regular trees at seers bank. also the OP's original script has a typo at the depositAllExcept method inside the int bank function twoards the bottom of the script. locate this and change the expect to Except and it should work pretty well.