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.

Need help getting item count from inventory on start

Featured Replies

I'm trying to set a variable on start from my inventory but it sets it to 0. I'm assuming because it's triggering before the character is actually loaded in. How can I go about this?
 

5 hours ago, Alakazizam said:

I'm trying to set a variable on start from my inventory but it sets it to 0. I'm assuming because it's triggering before the character is actually loaded in. How can I go about this?
 

onStart should always run after being logged in, very rarely it could happen earlier.
You sure your code is correct? I use this in a lot of my scripts and never heard of an issues with this

7 hours ago, Alakazizam said:

I'm trying to set a variable on start from my inventory but it sets it to 0. I'm assuming because it's triggering before the character is actually loaded in. How can I go about this?
 

how about setting the default value to null and make it get the count in the onloop if the var is still null 

  • Author
4 hours ago, Khaleesi said:

onStart should always run after being logged in, very rarely it could happen earlier.
You sure your code is correct? I use this in a lot of my scripts and never heard of an issues with this

I'll have to try again. Was burnt out this morning and may have messed up some maths lol

 

 

2 hours ago, xcx said:

how about setting the default value to null and make it get the count in the onloop if the var is still null 

Going to try to get the onStart method working again, but if that doesn't work out this is probably a good work around.

1 hour ago, Alakazizam said:

I'll have to try again. Was burnt out this morning and may have messed up some maths lol

 

 

Going to try to get the onStart method working again, but if that doesn't work out this is probably a good work around.

I mean if it really won't load the inventory, could do a conditionalSleep until 

myPlayer().exists(); or getInventory() !=null

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.