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.

Struggling with depositing

Featured Replies

So I'm trying to let my script deposit all except *something*, if in the deposit box's area.

It opens the deposit box, so that's good.
It doesn't deposit all except *something*, it deposits everything
Even though i'm telling it to deposit except certain items, so this is why I'm asking for help what I should do so it deposits all but certain items.

My code so far :

case BANK:
			if (inventory.isFull() && BANK_AREA.contains(myPlayer()));
			Entity BANK = objects.closest("Bank deposit box");
            log("Bank deposit box null?: " + (BANK == null));
                log("Bank deposit box has Deposit action: " + BANK.hasAction("Deposit"));
                if (!depositBox.isOpen()) {
                    if (depositBox != null) {
                        if (depositBox.open())
                            sleep(random(1000, 3000));
                        }
                    } else if (!inventory.isEmpty()) {
                    if (depositBox.depositAllExcept("Lobster pot, Coins, coins, Harpoon")) sleep(1000);

                    }

Thanks in advance,

depositBox.depositAllExcept("Lobster pot", "Coins", "coins", "Harpoon")

It takes an array (or varargs) of strings wink.png

Also:

if (!depositBox.isOpen()) {

if (depositBox != null) {

if (depositBox.open())

sleep(random(1000, 3000));

}

}

depositBox won't be null if you successfully called depositBox.isOpen() right? tongue.png

depositBox.open() checks if it's already open, so no need to double check that

Edited by Flamezzz

  • Author

depositBox.depositAllExcept("Lobster pot", "Coins", "coins", "Harpoon")

It takes an array (or varargs) of strings wink.png

Also:

if (!depositBox.isOpen()) {

if (depositBox != null) {

if (depositBox.open())

sleep(random(1000, 3000));

}

}

depositBox won't be null if you successfully called depositBox.isOpen() right? tongue.png

depositBox.open() checks if it's already open, so no need to double check that

 

So what would the new full case bank be? biggrin.png

Edited by ragfr00b

I think something like this would work

if (BANK_AREA.contains(myPlayer())) {

if(inventory.isFull()) {

// We do not assume open always succeeds

if(depositBox.open()) {

depositBox.depositAllExcept("Lobster pot", "Coins", "coins", "Harpoon");

}

} else {

// deposited stuff, now walk somewhere?

}

}

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.