Skip 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.

Glitch in Client?

Featured Replies

My script tells it to log out when it is below 1000 coins. My inventory has well over 1000 coins but the Debugger is saying I have no coins in my inventory.
 

 

 

 

301j1tu.png

 

Here is my code: 

if (getInventory().getAmount("Coins") <= 1000) {

log("Apparently I've got less than 1000 coins?");
log(("Amount of coins: ") + getInventory().getAmount("Coins"));
stop();
}

 

 

Edited by lg_juggles

Might be because OSBot *sometimes* thinks "Coins" does not exist? This may then explain why getAmount() returns 0, and gives a NPE.

 

I get this error sometimes, sometimes my scripts would stop "Out of coins", it happened rarely though.

Edited by DragonAlpha

  • Author

Why are you getting an NPE in Store?

 

The NPE isn't the problem though. The client is not recognizing that I have coins in the inventory. I was able to bypass this by using

 

if (getInventory().getAmount("Coins") <= 1000 && getInventory().getAmount("Coins") > 1) {

log("Apparently I've got less than 1000 coins?");

log(("Amount of coins: ") + getInventory().getAmount("Coins"));

stop();

}

 

so that means the client is not recognizing it sometimes 

Edited by lg_juggles

If you are constantly hopping and the condition is being check while you are logged out, wouldn't that be the problem?

 

I assume you are hopping since you are shop buying.

 

The NPE is the problem though. The client is recognizing that I have coins in the inventory. I was able to bypass this by using

 

if (getInventory().getAmount("Coins") <= 1000 && getInventory().getAmount("Coins") > 1) {

log("Apparently I've got less than 1000 coins?");

log(("Amount of coins: ") + getInventory().getAmount("Coins"));

stop();

}

 

so that means the client is recognizing it sometimes 

 

Interesting.

 

So the client sometimes tells us there are 0 coins in the inventory, I am unsure why at this point. So you are avoiding this by adding an extra check:

  1. Coins under 1000
  2. Coins greater than 1

Because this solution works, that does possibly hint towards something in the client. I would dismiss this as scripter error, but, it happens with me too sad.png

Edited by DragonAlpha

  • Author

If you are constantly hopping and the condition is being check while you are logged out, wouldn't that be the problem?

 

I assume you are hopping since you are shop buying.

I thought it wouldn't check the condition if it was logged out? That may be the problem then.

I thought it wouldn't check the condition if it was logged out? That may be the problem then.

 

 

Try adding this at the top of your onLoop(). Let us know if the problem still happens.

if(client.getLoginState() == Client.LoginState.LOGGED_OUT) {
   log("Waiting for login");
   return; // return 250;
}

I thought it wouldn't check the condition if it was logged out? That may be the problem then.

 

Not sure. Just a thought.

TFW is correct, the client handles data in a very obscure way keeping some data loaded when logged out.

You should always check your login state to be 30 before peforming an action otherwise this will create increasingly annoying issues.

Ultimately youll want to make sure there is an item called coins in your inventory (the item is not null ) and use this instance to invoke the method, as well as if you are in game before attempting any in game interactions.

Edited by Final

Oh cool I am correct

  • 2 weeks later...

Might be because OSBot *sometimes* thinks "Coins" does not exist? This may then explain why getAmount() returns 0, and gives a NPE.

 

I get this error sometimes, sometimes my scripts would stop "Out of coins", it happened rarely though.

thats since the inventory hasn't loaded yet. be sure to open the inventory if its not already before checking. errors like these will happen right when you log in

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.