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.

Script acting weird?

Featured Replies

So I have this in my script:

		case 2:
			if (getBank().open()) {
				waitTicks = 0;
				sleep(random(900, 1200));
				log("Bank is open check");
				for (int i = 0; i < 27; i++) {
					if (getInventory().getItemInSlot(i) != null) {
						if (getInventory().getItemInSlot(i).getName().equalsIgnoreCase(item1) && getInventory().getItemInSlot(i).getName().equalsIgnoreCase(item2) && getInventory().getItemInSlot(i).getName().equalsIgnoreCase(tool)) {
							getInventory().interact(i, "Deposit-All");
						}
					}
				}
				//getBank().depositAllExcept(item1, item2, tool);
				sleep(random(800, 1000));
				getBank().withdraw(item2, withdrawAmount);
				sleep(random(800, 1100));
				getBank().close();
				sleep(random(600, 800));
			}
			break;

 

 

I know case 2 is being called because it opens the bank and withdraws the item, but getBank().depositAll(String); was not working, getBank().depositAllExcept(String); was not working, and when I tried adding log(String);'s to make sure blocks were being reached, nothing happened and it was not showing in the log. The script STILL tries to withdraw the item, and i know the script is getting these changes because i changed the paint and that updated fine. Why is the ONLY thing in this entire snippet that's actually getting called the withdraw items?

18 hours ago, TTScripts said:

when I tried adding log(String);'s to make sure blocks were being reached, nothing happened and it was not showing in the log.

There's your problem, the switch case isn't being reached.

If you need help then you'll need to post us more of the code, namely the bit of code that decides the switch case.

  • Author

the switch is being called in onLoop and the conditions are being met for case 2:

case 2: is the ONLY place in the entire code that calls for withdrawing item from bank and as mentioned in the post, the script IS performing that function, but nothing else inside of case 2: is being called

I can't be of much help without seeing the entire script.

heads up, your problem is most likely in your if statement... 

"

if (getInventory().getItemInSlot(i).getName().equalsIgnoreCase(item1) && getInventory().getItemInSlot(i).getName().equalsIgnoreCase(item2) && getInventory().getItemInSlot(i).getName().equalsIgnoreCase(tool))"

If i'm understanding this correctly, you can't have 3 items in the same slot.

 

To fix this you should try changing your &&'s to ||'s

 

 

although, i may be looking at an entirely different thing. If you don't have a problem with the if statement and depositing then my suggestion is probably wrong.

Edited by angermidet1

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.