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.

bank.depositAll(); and bank.close(); do nothing?

Featured Replies

I'm trying to empty a players inventory into the bank then continue the script, but the above two lines do nothing without error.

if (!inventory.isEmpty()) {		//banks if anything in inventory
   map.walk([sample coords]);           //walk to bank
   bankbooth.interact("Bank");          //open bank
   bank.depositAll();                   //empty inventory into bank
   bank.close();                        //close bank window
}

Edited by karijuana

if you are scripting like this you better be safe. you should be using more if statement to ensure the safety of the script.

 

 

 

I'm trying to empty a players inventory into the bank then continue the script, but the above two lines do nothing without error.

if (!inventory.isEmpty()) {		//banks if anything in inventory
   map.walk([sample coords]);           //walk to bank
   bankbooth.interact("Bank");          //open bank
   bank.depositAll();                   //empty inventory into bank
   bank.close();                        //close bank window
}

 

 

You have one conditional, its obvious that this code wouldn't work. You need to first walk the path until your in the bank, then if your in a bank or a bank is near by, you can interact with the bank, then if the bank is open you can deposit all. You are just throwing it all in sequential order, there is no way this should work. If it does it would be completely unstable. 

  • Author

You have one conditional, its obvious that this code wouldn't work. You need to first walk the path until your in the bank, then if your in a bank or a bank is near by, you can interact with the bank, then if the bank is open you can deposit all. You are just throwing it all in sequential order, there is no way this should work. If it does it would be completely unstable. 

 

 

if you are scripting like this you better be safe. you should be using more if statement to ensure the safety of the script.

I realize this now, thanks for the advice as it's my first time bot scripting. I need to sleep after each action as well.

I realize this now, thanks for the advice as it's my first time bot scripting. I need to sleep after each action as well.

 

 

Not necessarily. If you have well formed conditional statements you can avoid alot of sleeping.

You have to check everything everytime, to make sure, that step will be made 100%, not so hard to switch to that type of thinking :)

 

I'm trying to empty a players inventory into the bank then continue the script, but the above two lines do nothing without error.

if (!inventory.isEmpty()) {		//banks if anything in inventory
   map.walk([sample coords]);           //walk to bank
   bankbooth.interact("Bank");          //open bank
   bank.depositAll();                   //empty inventory into bank
   bank.close();                        //close bank window
}

 

Try to put everything in a statements, so only 1 action gets ran every loop.

For example:

if(inventory.isFull()){
   if(inbank){
      if(bank.isopen){
         bank.depositAll();
      }else{
         //open bank
      }
   }else{
      //walk bank
   }

}else{
   //whatever u have to do
}

This is way easier to debugg if anything goes wrong and doesn't take as much errors/ memory.

 

Goodluck wink.png

Edited by Khaleesi

Guest
This topic is now closed to further replies.

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.