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.

Getting item from the bank

Featured Replies

Title tells it all.

I'm using bank.getItem("String")

My code opens the bank, but it just closes it without grabbing what I need, and just repeats itself.

if (!inventory.contains("Small fishing net")) {
			if(banker.isVisible()) {
				camera.toEntity(banker);
				banker.interact("Bank");
				sleep(random(700,1000));
				bank.getItem("Small fishing net");
				sleep(random(500,1000));
				
			} else {
				getWalking().walk(bank_location);
			}

 

I'm not sure if I'm using sleep properly by the way. Could somebody also explain why sleep is needed?

				bank.getItem("Small fishing net");
That does not withdraw an item

getBank.withdraw("item", amount);

 

Also check if bank is open before withdrawing 

if (!getInventory().contains("Small fishing net")) {
			if (banker != null && banker.exists) {
				if  (banker.isVisible()) {
				banker.interact("Bank");
				new ConditionalSleep(5000) { // ConditionalSleep will sleep for 5 seconds or until the bank is open
					 public boolean condition() {
                           return getBank().isOpen(); }
                       }.sleep();
				bank.withdraw(1, "Small fishing net");
				new ConditionalSleep(5000) {
					 public boolean condition() {
                           return getInventory().contains("Small fishing net"); }
                       }.sleep()
				
			} else {
				getWalking().walk(bank_location);
}

there might be a few missing brackets }, but u can just add those in

getItems(), would get array of items stored in the container.

In this case, you should be using withdraw().

 

  • Author
10 minutes ago, Charlotte said:

getItems(), would get array of items stored in the container.

In this case, you should be using withdraw().

 

derp, thanks bruv.

15 minutes ago, Juggles said:

				bank.getItem("Small fishing net");
That does not withdraw an item

getBank.withdraw("item", amount);

 

Also check if bank is open before withdrawing 

Thanks, I just started to learn to code. I'm not sure what kind of checks I should be doing, there's a lot to think about - _ -

 

50 minutes ago, kingbutton said:

derp, thanks bruv.

Thanks, I just started to learn to code. I'm not sure what kind of checks I should be doing, there's a lot to think about - _ -

 

It's mostly logic. If you were playing and want to withdraw something from the bank, wouldn't you first wait for the bank to open before withdrawing something? :) That's how it goes

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.