Jump to content

Draynor bank walking to wrong booth?


backwardsdirty

Recommended Posts

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
Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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