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.

How to get any bank booths location

Featured Replies

Wanting to do something like

camera.toPosition(getBank().getPosition());

 

I don't think there is anything in built for this, that I have seen atleast.

 

Any help appreciated

getBank() returns an instance of the Bank class, the bank class does not represent an actual bank but rather an "API regarding bank functionality".

  • Author

getBank() returns an instance of the Bank class, the bank class does not represent an actual bank but rather an "API regarding bank functionality".

 

Though it has to get the actual bank booth object / npc from somewhere right? I'm just looking for a way to access this so I can get its position when it finds one

Edited by Mykindos

Though it has to get the actual bank booth object / npc from somewhere right? I'm just looking for a way to access this so I can get its position when it finds one

 

Doesn't work that way ^^

You have to find the entity yourself :)

Though it has to get the actual bank booth object / npc from somewhere right? I'm just looking for a way to access this so I can get its position when it finds one

You'll have to find the bank/npc yourself and interact with it

RS2Object booth = getObjects().closest("Bank booth);

booth.interact("Bank"); //clicks bank
booth.getPosition(); //returns position

But you should already know that right?

  • Author
RS2Object booth = getObjects().closest("Bank booth);

booth.interact("Bank"); //clicks bank
booth.getPosition(); //returns position

But you should already know that right?

 

 

I was looking for a more convenient method of getting all types of banks, like npcs  as well.

 

Unless OSBot doesnt interact with npc banks, in that case I am retarded.

I was looking for a more convenient method of getting all types of banks, like npcs  as well.

 

Unless OSBot doesnt interact with npc banks, in that case I am retarded.

 

There is no way to detect globally all banks. You can just change it to npc then.

If you want to account for both NPCs & Objects:

 

1. Put all NPCs and RS2Objects in an Entity list.

2. Filter that list for entities that have a "Bank" action.

3. Take a random entity from the list or sort the whole list by distance using a Comparator and take the first one (if you'd like the closest).

4.Profit.

 

Alternatively you can look for the closest NPC and then for the closest Object and then compare the two and take the closest one.

  • Author

There is no way to detect globally all banks. You can just change it to npc then.

 

Yeah, will have to do that.

 

Dont know why I didn't just look at this from the start

h3ROY.png

private final String bankBooth = "Bank Booth";

Entity booth = getObjects().closest(bankBooth);
                
                if (booth != null) {
                    camera.toPosition(booth.getPosition());
                }
/* or */

Entity booth = getObjects().closest(bankBooth);

                if (booth != null) {
                    camera.toPosition(new Position(booth.getPosition()));
                }

all I can think of

Edited by Acinate

// variables

    private Area bankArea = new Area(x1, y1, x2, y2);


// main method

    private void openBank() {
        int x = random(1, 3);
        adjustCamera();
        if (x == 1 || x == 2) {
            Entity bankBooth = objects.closest("Bank booth");
            if (bankBooth.exists() && bankArea.contains(bankBooth)) {
                if (bankBooth.isVisible()) {
                    bankBooth.interact("Bank");
                    sleepFor(500, 900);
                }
                if (!bankBooth.isVisible()) {
                    localWalker.walk(bankBooth.getPosition(), false);
                    sleepFor(750, 1500);
                }
            }
        }
        if (x == 3) {
            NPC banker = npcs.closest("Banker");
            if (banker.exists() && bankArea.contains(banker)) {
                if (banker.isOnScreen()) {
                    banker.interact("Bank");
                    sleepFor(500, 900);
                }
                if (!banker.isOnScreen()) {
                    localWalker.walk(banker.getPosition(), false);
                    sleepFor(750, 1500);
                }
            }
        }
    }


// true or false methods

    private boolean bankScreenOpen() {
        return this.bank.isOpen();
    }

    private boolean playerIsAtBank() {
        return this.bankArea.contains(myPlayer());
    }


// custom methods

    private void sleepFor(int x, int y) {
        try {
            sleep(random(x, y));
        } catch (InterruptedException e) {
            log("interrupted sleep exception");
            e.printStackTrace();
        }
    }

    private void adjustCamera() {
        if (camera.getPitchAngle() <= 60) {
            camera.toTop();
        }
    }

hope this helps! I plan on releasing some tutorials soon to help the community grow, since I noticed there was little to no tutorials. In the walk method, you can change the false to true to change the camera angle sometimes. you should also be able to figure out how to get the camera to do your bidding with the examples above. Normally i only move the camera up and down when i play which is why i have adjustCamera(). i use it quite often actually.

Edited by shiny greninja

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.