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.

Noob question... how to bank?

Featured Replies

           Entity bank = objects.closest("Bank booth");
            bank.interact("Bank");
            sleep(random(100));
            getBank().depositAll();

 

I've imported bank, this doesnt work?

5 minutes ago, jiggerjaw said:

           Entity bank = objects.closest("Bank booth");
            bank.interact("Bank");
            sleep(random(100));
            getBank().depositAll();

 

I've imported bank, this doesnt work?

Not every location has a bank booth.

Bank booths are an RS2Object, not an Entity,

also you might want to do a != null check.

Edited by Hydra

16 minutes ago, jiggerjaw said:

           Entity bank = objects.closest("Bank booth");
            bank.interact("Bank");
            sleep(random(100));
            getBank().depositAll();

 

I've imported bank, this doesnt work?

Use getBank().open()

  • Author

Ha, shoulda been more specific... the bank opens perfectly fine, it doesn't deposit.  Guess it could be that it's trying to deposit before the bank is open, I'll try that.  Thanks Jugs

*How do I give +Rep?  I clicked the check mark and nothing happened

Edited by jiggerjaw

20 minutes ago, jiggerjaw said:

Ha, shoulda been more specific... the bank opens perfectly fine, it doesn't deposit.  Guess it could be that it's trying to deposit before the bank is open, I'll try that.  Thanks Jugs

*How do I give +Rep?  I clicked the check mark and nothing happened

Yes, in your snippet you are sleeping for 0-100ms, not exactly long enough for the bank to open, especially if your player has to walk there first.

If you use getBank().open() it will sleep until the bank is open, so something like this should work:

 

if (!getBank().isOpen()) {
    getBank().open();
} else {
    getBank().depositAll();
}

 

1 hour ago, Hydra said:

Bank booths are an RS2Object, not an Entity,

also you might want to do a != null check.

RS2Object is a subinterface of Entity, so what he wrote is fine:

60a9364e7601a0ec7610ef9bdc6a2d7f.png

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.