backwardsdirty Posted July 15, 2022 Share Posted July 15, 2022 (edited) At first i was using Banks.DRAYNOR to get to the bank, but I am assuming there is just something wrong with the checks I am doing to determine which bank booth I use because my script is just going to the nearest one which usually with pathing is the fake ones. To mitigate (I thought), i made the Area for the bank smaller so the bot would click in that area instead and land closer to the real booths causing it to interact, but that didnt work either. public void DBank() { if (DBank.contains(myPlayer())) { if (bank.isOpen()) { getBank().depositAllExcept("Bronze axe","Steel axe","Iron axe","Mithril axe","Black axe","Adamant axe", "Rune axe", "Dragon axe"); getBank().close(); } else { RS2Object bankbooth = getObjects().closest("Bank booth"); logger.debug("Accessing Bank Booth."); if (bankbooth != null && bankbooth.hasAction("Bank")) { if (bankbooth.hasAction("Bank")) { bankbooth.interact("Bank"); delay = random(611, 902); } else { camera.toEntity(bankbooth); camera.movePitch(random(camera.getPitchAngle() -1, camera.getPitchAngle()+1)); There is my Draynor banking snippet. EDIT: I also tried changing my code from if(bankbooth.isVisible() to if(bankbooth.hasAction("Bank") even though that check is above it just to make double sure that wasn't where it is going wrong. The logger does say "Accessing Bank Booth", but i tried throwing another if statement saying if it was visible and it didn't print anything. Edited July 15, 2022 by backwardsdirty Quote Link to comment Share on other sites More sharing options...
Ricky Dactyl Posted July 15, 2022 Share Posted July 15, 2022 RS2Object bankbooth = getObjects().closest(obj -> obj.getName().equalsIgnoreCase("Bank booth") && obj.hasAction("Bank")); Don't have access to an IDE at the moment but I'd implement lambda expressions so you can ensure that the object you're pulling has the action you want available. Hope this helps 1 Quote Link to comment Share on other sites More sharing options...
backwardsdirty Posted July 16, 2022 Author Share Posted July 16, 2022 So I did get this far RS2Object bankbooth = getObjects().closest(o -> o.getName().equals("Bank booth")) I added the && o.hasAction("Bank")); and it works flawlessly. So simple, thanks so much! 1 Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted July 16, 2022 Share Posted July 16, 2022 10 hours ago, backwardsdirty said: So I did get this far RS2Object bankbooth = getObjects().closest(o -> o.getName().equals("Bank booth")) I added the && o.hasAction("Bank")); and it works flawlessly. So simple, thanks so much! Just use getBank.open() method 2 Quote Link to comment Share on other sites More sharing options...
backwardsdirty Posted July 16, 2022 Author Share Posted July 16, 2022 3 hours ago, Khaleesi said: Just use getBank.open() method this is what I went with : if (Banks.DRAYNOR.contains(myPlayer())) { if (!bank.isOpen()) { bank.open(); new ConditionalSleep(2500, 3000) { @Override public boolean condition() { return bank.isOpen(); } }; } } if(bank.isOpen()){ bank.depositAllExcept("Bronze axe", "Steel axe", "Iron axe", "Mithril axe", "Black axe", "Adamant axe", "Rune axe", "Dragon axe"); bank.close(); } else { walkToDestination(Banks.DRAYNOR); } } Looks much cleaner than what I had before, thank you as well! Quote Link to comment Share on other sites More sharing options...
abc3 Posted July 16, 2022 Share Posted July 16, 2022 51 minutes ago, backwardsdirty said: this is what I went with : if (Banks.DRAYNOR.contains(myPlayer())) { if (!bank.isOpen()) { bank.open(); new ConditionalSleep(2500, 3000) { @Override public boolean condition() { return bank.isOpen(); } }; } } if(bank.isOpen()){ bank.depositAllExcept("Bronze axe", "Steel axe", "Iron axe", "Mithril axe", "Black axe", "Adamant axe", "Rune axe", "Dragon axe"); bank.close(); } else { walkToDestination(Banks.DRAYNOR); } } Looks much cleaner than what I had before, thank you as well! He means you only need to call getBank.open() and nothing else. It will walk to the closest bank for you Quote Link to comment Share on other sites More sharing options...
backwardsdirty Posted July 16, 2022 Author Share Posted July 16, 2022 3 minutes ago, abc3 said: He means you only need to call getBank.open() and nothing else. It will walk to the closest bank for you I understand that after reading the API page, but I want it to go to specific banks which it does and it solves the issue I had with it walking to a bank booth that wasn't usable in the first place. Thank you though! Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted July 16, 2022 Share Posted July 16, 2022 (edited) 3 hours ago, backwardsdirty said: I understand that after reading the API page, but I want it to go to specific banks which it does and it solves the issue I had with it walking to a bank booth that wasn't usable in the first place. Thank you though! The getBank.open() deals with this already, it does check for a Bank option afaik It will even walk yourself to the closest bank if you use it. For example: 1. Chop logs at port sarim 2. Call getBank.open() 3. It will walk to the closest bank available amd opens it Edited July 16, 2022 by Khaleesi Quote Link to comment Share on other sites More sharing options...
backwardsdirty Posted July 16, 2022 Author Share Posted July 16, 2022 1 hour ago, Khaleesi said: The getBank.open() deals with this already, it does check for a Bank option afaik It will even walk yourself to the closest bank if you use it. For example: 1. Chop logs at port sarim 2. Call getBank.open() 3. It will walk to the closest bank available amd opens it Interesting, I will have to try that out! I'll post an update if I go that route. Thanks again for the help. 1 Quote Link to comment Share on other sites More sharing options...