April 6, 201312 yr This is based of maxi's draynor chopper! This is my first script. Start in Catherby bank with a axe equipped as I have not learned that far slowly learning! Tested for 1 hour got 1 random and 800 oak logs! 2 problems with script is it hasn't got random support other then moving of the camera will add more on a later date!, Banks the axe @ScriptManifest(name = "PPOaker", author = "PengPhin", version = 1.0D)class PPOaker extends Script { int bankId = 2213 int[] treeIds = [3037, 10083, 13413, 1281] enum State { IDLE, CHOPPING, WALK_TO_BANK, PIN, BANKING, WALK_TO_OakS } def state = State.IDLE def currentTree = null 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_OakS: return walkToOaks() } return 3000 + random(2000) } int onIdle() { if (client.getInventory().isFull()) { state = State.WALK_TO_BANK //client.moveCameraToEntity(closestObject(bankId)) return 800 + gRandom(800, 400) } currentTree = closestObject(treeIds) if(currentTree != null) { log("Closest Oak tree : (${currentTree.getX()}, ${currentTree.getY()})") selectEntityOption(currentTree, "Chop down", "Oak") if (random(5) == 0) { client.moveCameraToEntity(currentTree) sleep(700 + gRandom(500, 200)) } } return 1500 + gRandom(2000, 500); } int onChopping() { if (client.getInventory().isFull()) { state = State.WALK_TO_BANK //client.moveCameraToEntity(closestObject(bankId)) return 800 + gRandom(800, 400) } if (random(30) == 0 && currentTree != null && currentTree.exists()) client.moveCameraToEntity(currentTree) if (currentTree == null) { state = State.IDLE log("Chopped down Oak!") return 500 + gRandom(1000, 500) } if (!currentTree.exists()) { state = State.IDLE currentTree = null log("Chopped down Oak!") } return 500 + gRandom(1000, 500) } int walkToBank() { selectEntityOption(closestObject(bankId), "Bank", "Bank booth") if (myX() <= 2756 && myX() >= 3429 && myY() >= 2809 && myY() <= 3435) { return 800 + gRandom(500, 200) } sleep(1000 + gRandom(300, 50)) if (client.getBank().isOpen()) state = State.BANKING return 500 + gRandom(1000, 400) } int bank() { client.getBank().depositAllExcept() state = State.WALK_TO_OakS def tree = closestObject(treeIds) //if (tree != null) //client.moveCameraToEntity(tree) return 500 + gRandom(700, 300) } int walkToOaks() { log("Walking to Oak Trees") currentTree = closestObject(treeIds) if (currentTree != null) { log("Closest Oak tree : (${currentTree.getX()}, ${currentTree.getY()})") selectEntityOption(currentTree, "Chop down", "Oak") client.moveCameraToEntity(currentTree) } return 2000 + gRandom(800, 300) } void onMessage(String message) { if (message == "You swing your axe at the tree.") { log("Chopping down Oak 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 } } } Please let me know what you think!
April 6, 201312 yr If the bank is not within reach, it will just stand idle with a full inventory. Could you make it so that if the bank is not visible, then walk to a tile that is towards the bank?
April 6, 201312 yr Author Sorry United I only did this cause i was asked to it's because the client has been updated and well something went wrong
April 8, 201312 yr I would love to test this but the numbering on the left will be tedious to remove.
April 8, 201312 yr I would love to test this but the numbering on the left will be tedious to remove. Just copy and paste it wont highlight the numbers.
April 10, 201312 yr I would love to test this but the numbering on the left will be tedious to remove. you can past it in word then select all and click numbering button and it will remove them, then you can copy it from word
April 11, 201312 yr It works fine for a while, then just stops.Also, it has no feature to click past a level up screen. And if it stops chopping due to anything, it doesn't click the tree again.
April 13, 201312 yr Script doesn't do anything if you level up. It'll sit there at the Congratulations Screen and do nothing. Just sits there, maybe check for if the character isn't doing anything click the closest tree. Edit: So I'm still having the issue, where it'll only stop working if it runs into the Level Up message in the Chat Box. Ummm, I'm not having a problem stopping and rerunning to click okay though, because everything else works out fine and I check to make sure I have no randoms regardless. Nice script overall, hopefully you can get the level up issue fixed. Also please note that the Oaks are near the Jail Guards, which will attack players lower level than it I think. So as a level 3, you will end up dying if you aren't watching your bot and one of those Guards attacks you. Maybe have the script only chop the one Oak Tree located directly next to the bank, so that no Guard can get to you! Edited April 13, 201312 yr by Speakmore