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.

Nullpointer Exception using Worlds

Featured Replies

Hello y'all,

I just started making my first private script and it is close to finished however worldhopping is not working for me for some reason.

Worlds worldhop = new Worlds();
store.close();
if(worldhop!=null) {
    worldhop.getWorlds().hopToF2PWorld();
    this.x = x - x;
}

This is the code and I get this in the logger:

[ERROR][Bot #1][07/01 08:30:41 PM]: Error in script executor!
java.lang.NullPointerException at Main.onLoop(Main.java:51)
at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(kl:223)
at java.lang.Thread.run(Unknown Source)

line 51 is worldhop.getWorlds().hopToF2PWorld();

The problem has nothing to do with store.close(); I already tested this.

Does anybody have a clue why I get this error? If I fix this my first script is finally done ?

Thanks in advance for all the help!

You're not calling the world hopping correctly. If you're in your main class you can do getWorlds().hopToF2PWorld();
The reason you're getting an NPE is it's looking for your script instance for context, when you're creating your own Worlds object it doesn't have this context.

  • Author
9 minutes ago, Night said:

You're not calling the world hopping correctly. If you're in your main class you can do getWorlds().hopToF2PWorld();
The reason you're getting an NPE is it's looking for your script instance for context, when you're creating your own Worlds object it doesn't have this context.

So I have te remove the declaration and initialisation of worlds? let me try.

11 minutes ago, Night said:

You're not calling the world hopping correctly. If you're in your main class you can do getWorlds().hopToF2PWorld();
The reason you're getting an NPE is it's looking for your script instance for context, when you're creating your own Worlds object it doesn't have this context.

ow damn it worked!!!! thank you so much!!! <3

  • Alek locked this topic
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.