t0r3 Posted March 31, 2019 Share Posted March 31, 2019 (edited) Hey 1) Better to have getBank().depositAll(axes) in if (canGetSteelAxe && axeInBank) {} or in boolean axeInBank = getBank().contains(axes -> axes.getName().endsWith("axe")) && getBank().depositAll(axes); like I already do? Thinking having it in each of the if's would require less from the cpu, rather than calling it every single time I'm using my getAxes() method? EDIT: Had to change things up, so that bot wouldn't withdraw and deposit axe every single time before proceeding. 2) Would it be better to include ex. getBank().withdraw("Steel axe", 1); in boolean canGetSteelAxe = (wcLvl > 6 && wcLvl < 21) && getBank().contains(axes); , and just leave it with getBank().depositAll(axes); log("Withdrawing Steel axe"); ? ...Sorry if the question is confusing hahah. getAxes() code : private void getAxes() { int wcLvl = getSkills().getStatic(Skill.WOODCUTTING); boolean canGetSteelAxe = (wcLvl > 6 && wcLvl < 21) && getBank().contains(axes) && !getInventory().contains("Steel axe"); boolean canGetMithrilAxe = (wcLvl >= 21 && wcLvl < 31) && getBank().contains(axes) && !getInventory().contains("Mithril axe"); boolean canGetAdamantAxe = (wcLvl >= 31 && wcLvl < 41) && getBank().contains(axes) && !getInventory().contains("Adamant axe"); boolean canGetRuneAxe = wcLvl >= 41 && getBank().contains(axes) && !getInventory().contains("Rune axe"); boolean axeInBank = getBank().contains(axes -> axes.getName().endsWith("axe")); if (canGetSteelAxe && axeInBank) { getBank().depositAll(axes); log("Withdrawing Steel axe"); getBank().withdraw("Steel axe", 1); } if (canGetMithrilAxe && axeInBank) { getBank().depositAll(axes); log("Withdrawing Mithril axe"); getBank().withdraw("Mithril axe", 1); } if (canGetAdamantAxe && axeInBank) { getBank().depositAll(axes); log("Withdrawing Adamant axe"); getBank().withdraw("Adamant axe", 1); } if (canGetRuneAxe && axeInBank) { getBank().depositAll(axes); log("Withdrawing Rune axe"); getBank().withdraw("Rune axe", 1); } } Edited March 31, 2019 by t0r3 Quote Link to comment Share on other sites More sharing options...
Imthabawse Posted March 31, 2019 Share Posted March 31, 2019 Why no black axe!? Quote Link to comment Share on other sites More sharing options...
t0r3 Posted March 31, 2019 Author Share Posted March 31, 2019 7 minutes ago, Imthabawse said: Why no black axe!? hahah No one use black axe Got any suggestions though? : ) Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted March 31, 2019 Share Posted March 31, 2019 I'd suggest looking at Enums. Quote Link to comment Share on other sites More sharing options...
Imthabawse Posted March 31, 2019 Share Posted March 31, 2019 3 minutes ago, t0r3 said: hahah No one use black axe Got any suggestions though? : ) I do.. lol but on a serious note as I said before I personally have not used booleans so I would write something like: If (wcLvl > 21 && wcLvl < 31) { getWalking.webWalk(bank) getbank.open deposit steelaxe withdraw mithrilaxe Wrote on phone so yeah.. Quote Link to comment Share on other sites More sharing options...
t0r3 Posted March 31, 2019 Author Share Posted March 31, 2019 13 minutes ago, Imthabawse said: I do.. lol but on a serious note as I said before I personally have not used booleans so I would write something like: If (wcLvl > 21 && wcLvl < 31) { getWalking.webWalk(bank) getbank.open deposit steelaxe withdraw mithrilaxe Wrote on phone so yeah.. Yeah that would work I think, but I don't want to do that in the middle of cutting wood. Wanna wait till banking 15 minutes ago, HeyImJamie said: I'd suggest looking at Enums. Thanks! Any examples, and in relation what? Quote Link to comment Share on other sites More sharing options...
Imthabawse Posted March 31, 2019 Share Posted March 31, 2019 @t0r3 in that case you could add to if (wcLvl > 21 && wcLvl < 31 && getInventory.isFull) { walk.bank Etc.. Quote Link to comment Share on other sites More sharing options...
t0r3 Posted March 31, 2019 Author Share Posted March 31, 2019 (edited) 8 minutes ago, Imthabawse said: @t0r3 in that case you could add to if (wcLvl > 21 && wcLvl < 31 && getInventory.isFull) { walk.bank Etc.. I have this in my banking method Might have to change some stuff tho private void needToBank() throws InterruptedException { boolean axeInInventory = getInventory().contains(axes -> axes.getName().endsWith("axe")); if (!Banks.LUMBRIDGE_UPPER.contains(myPosition())) { getWalking().webWalk(Banks.LUMBRIDGE_UPPER); } if (getInventory().isEmpty() || !axeInInventory){ getBank().open(); SleepEasy.sleepUntil(() -> getBank().isOpen(), 18000); if (getBank().contains(axes)) { getAxes(); } } if (getInventory().isFull()) { getBank().open(); SleepEasy.sleepUntil(() -> getBank().isOpen(), 14000); if (getBank().isOpen() && getInventory().contains(logs -> logs.getName().endsWith("logs"))) { getBank().depositAllExcept(axes); } if (getBank().contains(axes)) { getAxes(); } } } Edited March 31, 2019 by t0r3 Quote Link to comment Share on other sites More sharing options...
Imthabawse Posted March 31, 2019 Share Posted March 31, 2019 Wouldnt it try to keep getting an axe out of the bank after wcLvl >= 41 "Rune axe"? Have you tested this? Quote Link to comment Share on other sites More sharing options...
t0r3 Posted March 31, 2019 Author Share Posted March 31, 2019 (edited) 8 minutes ago, Imthabawse said: Wouldnt it try to keep getting an axe out of the bank after wcLvl >= 41 "Rune axe"? Have you tested this? Yeah maybe. No, haven't tested it. But when using the other axes, it already has the desired axe in inventory and is not stuck trying to withdraw/deposit other axes. So guess that it still would work. Could set it to == 41 probably idk u making a progressive script too? hehe EDIT: yes, it got stuck lol. changed it to ; boolean canGetMithrilAxe = (wcLvl >= 21 && wcLvl < 31) && getBank().contains(axes); boolean canGetAdamantAxe = (wcLvl >= 31 && wcLvl < 41) && getBank().contains(axes); Edited March 31, 2019 by t0r3 Quote Link to comment Share on other sites More sharing options...
Imthabawse Posted March 31, 2019 Share Posted March 31, 2019 Actually id use that to get all axes.. ex: If(wcLvl == 21) { get Mithril axe And no i'm not making a progressive script I just write scripts for tasks I dont wanna do lol Quote Link to comment Share on other sites More sharing options...
t0r3 Posted March 31, 2019 Author Share Posted March 31, 2019 2 minutes ago, Imthabawse said: Actually id use that to get all axes.. ex: If(wcLvl == 21) { get Mithril axe And no i'm not making a progressive script I just write scripts for tasks I dont wanna do lol Yeah, but what if the script starts at lvl 24 and has a steel axe equipped? Then it would not withdraw another axe before reaching lvl 31? Quote Link to comment Share on other sites More sharing options...
Imthabawse Posted March 31, 2019 Share Posted March 31, 2019 Yeah true guess thatd only be good from lvl 1 Quote Link to comment Share on other sites More sharing options...
t0r3 Posted March 31, 2019 Author Share Posted March 31, 2019 (edited) 14 minutes ago, Imthabawse said: Yeah true guess thatd only be good from lvl 1 yeah Discovered it would always deposit the current axe before withdrawing it again, each time banking. Changed it to; boolean canGetSteelAxe = (wcLvl > 6 && wcLvl < 21) && getBank().contains(axes) && !getInventory().contains("Steel axe"); so that it will only get the steel axe when it is not in inventory Also moved getBank().depositAll(axes); out of boolean axeInBank into if (canGetSteelAxe && axeInBank) aaand now it works lol, always something wrong Changed it in the OP too. Edited March 31, 2019 by t0r3 Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted March 31, 2019 Share Posted March 31, 2019 https://github.com/HeyImJamie/JProgressiveWoodcutter/tree/master/src/scripts/JProgressiveWoodcutter Take a look at this. It's for a separate client, but should give you a right idea. The enum and best axe method can be found in the data folder. 1 Quote Link to comment Share on other sites More sharing options...