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.

Hold script from running while logging in?

Featured Replies

I've noticed when running OSBot in debug mode I am getting a lot of null pointer errors because my bot is not logged in yet and the world has not loaded. Is there a best practise method for holding the script until the world is correctly loaded in?

Cheers!

if(getClient().isLoggedIn())

 

9 minutes ago, Slut said:

if(getClient().isLoggedIn())

 

This returns true during the "Loading please wait" message aswell, and items will still return null.

Edited by Shudsy

6 minutes ago, Shudsy said:

This returns true during the "Loading please wait" message aswell, and items will still return null.

I've never had an issue with this and I use it alongside ingame widgets that are only visible once things are loaded, but noted

  • Author

Any checks for world loaded? Maybe checking if the character is visible...? lol

widgets -> singleFilter -> parent 548 ->hasAction Look North 

 

Sorry in a rush can't write the code, check if that widget is visbile 

I like to use player indexes on first startup

 

if (getClient().getMyPlayerIndex() > 0) { //or whatever
	//.....
}

 

  • Author
On 2017-5-23 at 10:06 AM, Shudsy said:

This returns true during the "Loading please wait" message aswell, and items will still return null.

public boolean isLoggedIn()
Returns if you are currently logged in.
Returns:
True if logged in and not logged out or 'loading please wait...'.

Is the api docs out of date? or is the description wrong?

8 minutes ago, Tasemu said:

public boolean isLoggedIn()
Returns if you are currently logged in.
Returns:
True if logged in and not logged out or 'loading please wait...'.

Is the api docs out of date? or is the description wrong?

Not sure, but isLoggedIn() always bugs out for me when checking for items 

Couldn't you just check if the player is visible?

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.