Jump to content

Draynor bank walking to wrong booth?


Recommended Posts

Posted (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 by backwardsdirty
Posted
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!

Posted
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

Posted
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!

Posted (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 :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
Posted
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.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...