Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Draynor bank walking to wrong booth?

Featured Replies

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 by backwardsdirty

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

  • Author

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!

  • Author
3 hours ago, Khaleesi said:

Just use getBank.open() method :D

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!

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

  • Author
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!

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 :D
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 :D

Edited by Khaleesi

  • Author
1 hour ago, Khaleesi said:

The getBank.open() deals with this already, it does check for a Bank option afaik :D
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 :D

Interesting, I will have to try that out! I'll post an update if I go that route. Thanks again for the help.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.