Vogelbekdier Posted May 17, 2019 Share Posted May 17, 2019 (edited) So I made a simple script that cuts oaks at Draynor, walks to the bank and banks the logs. I'm trying to have the script chop Oak in my own defined area that only contains one Oak tree, the area I defined to chop Oak in also contains 2 normal tree's. My goal is to have the script chop Oak but if the Oak is chopped down as a secondary task it will chop down the tree's within the area until the oak respawns. Currently using the following code that does not work as I'm sure the order is completely wrong: private void chop() throws InterruptedException { RS2Object Oak = getObjects().closest(choppingGround, "Oak"); RS2Object Tree = getObjects().closest(choppingGround, "Tree"); if (readyToCut() && Oak != null) { sleep(random(150, 3000)); Oak.interact("Chop Down"); log("Chopping oak."); sleep(random(650, 800)); getMouse().moveOutsideScreen(); } else if (readyToCut() && Oak == null && Tree != null) { sleep(random(150, 3000)); Tree.interact("Chop Down"); log("Chopping tree."); sleep(random(600, 800)); getMouse().moveOutsideScreen(); new ConditionalSleep(2300) { @Override public boolean condition() { return myPlayer().isAnimating(); } }.sleep(); } else if (!choppingGround.contains(myPlayer())) { log("walking back to tree's."); getWalking().webWalk(choppingGround); } } Edited May 17, 2019 by Vogelbekdier Quote Link to comment Share on other sites More sharing options...
Imthabawse Posted May 17, 2019 Share Posted May 17, 2019 If (!getbank.isopen) { Getbank.open; } else if (getbank.isopen && getinventory.contains ("Willow logs") { Getbank.depositall ("Willow logs"); Something like this should work. If not remove the else and just use if. Writing off phone so can't confirm. Quote Link to comment Share on other sites More sharing options...
FuryShark Posted May 17, 2019 Share Posted May 17, 2019 6 minutes ago, Vogelbekdier said: So I made a simple script that cuts willows at Draynor, walks to the bank and banks the logs. To bank the logs I'm using if(getInventory().contains("Willow logs") && bank.isOpen()) { getBank().depositAll(); } It opens the bank just fine and everything is working but for some reason, it won't bank the willow logs. Have you remembered to click refresh before running it? Quote Link to comment Share on other sites More sharing options...
Vogelbekdier Posted May 17, 2019 Author Share Posted May 17, 2019 3 minutes ago, FuryShark said: Have you remembered to click refresh before running it? I did but wasn't working however, I just deleted and recompiled the script and restarted the client and everything is working fine now! Thank you. 1 Quote Link to comment Share on other sites More sharing options...
Evn Posted May 17, 2019 Share Posted May 17, 2019 Goodluck ! Quote Link to comment Share on other sites More sharing options...
Imthabawse Posted May 18, 2019 Share Posted May 18, 2019 Just curious but why cut reg tree's past lvl 15 woodcutting? Look around for an unpopular spot that has 3 or more oaks with bank relatively close by and chop/bank for $'s and decent lvls. Quote Link to comment Share on other sites More sharing options...