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.

GraphicUtilities NullPointerException when starting script

Featured Replies

1. OSBot Version (do NOT put "current version", be specific)

OSBot 2.5.20

 

2. A description of the issue. Include relevant logs.

After today's update, when I start my script through CLI I get the following error as shown at point 3. I'm using -allow norandoms.

It doesn't show one of my own logs (even when put at the top), so I cant figure out where the error is coming from.

 

3. Are you receiving any errors in the client canvas or the logger?

[ERROR][Bot #1][09/10 11:33:54 AM]: Error in script onStart(): 
java.lang.NullPointerException
    at org.osbot.rs07.api.util.GraphicUtilities.getMainInterfaceId(ei:122)
    at org.osbot.rs07.api.util.GraphicUtilities.cache(ei:82)
    at org.osbot.rs07.event.ScriptExecutor.IIiiIiiIiiiI(cg:256)
    at org.osbot.rs07.event.ScriptExecutor.start(cg:116)
    at org.osbot.y.run(wx:186)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

 

4. How can you replicate the issue?

I can't really replicate it other than starting my script.

 

5. Has this issue persisted through multiple versions? If so, how far back?

Nope, everything was working perfect in OSBot 2.5.18 and before. After the update it began to show this error.

1 hour ago, Alek said:

Let me know if this response helps you, or if you have anything more to contribute.

 

Seems like no matter when norandoms is used within CLI, it triggers it. Using a blank skeleton and it still throws NPE if using norandoms.

 

import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

@ScriptManifest(name="NoRandoms", info="", author="D", version=0, logo="")
public class NoRandoms extends Script{

    @Override
    public void onStart() {
        log("Start");
    }

    public int onLoop() throws InterruptedException {
        log("Loop");
        return 75;
    }
}

 

36 minutes ago, Duhstin said:

 

Seems like no matter when norandoms is used within CLI, it triggers it. Using a blank skeleton and it still throws NPE if using norandoms.

 


import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

@ScriptManifest(name="NoRandoms", info="", author="D", version=0, logo="")
public class NoRandoms extends Script{

    @Override
    public void onStart() {
        log("Start");
    }

    public int onLoop() throws InterruptedException {
        log("Loop");
        return 75;
    }
}

 

You're trying to start the script logged out, Graphic Utilities wants to cache. It can't cache properly because you're not logged in. The way OSBot works is that your script doesn't start until you are fully logged in. When you're in -norandoms mode, it starts whether you are logged in or not. Therefore start the script when logged in.

Edit: Making a final patch

Exactly as Elysiano is saying, only triggers with norandoms. Using the exact same script running just fine on 2.5.18 but breaks in .19/.20. The script is launched with the same CLI commands I normally use, even puting in a sleep before calling everything else in onStart gets ignored. Same error using the script without an onStart method still NPE pointed at onStart. Not sure what else to test to see where it's coming from.

14 minutes ago, Zummy said:

Exactly as Elysiano is saying, only triggers with norandoms. Using the exact same script running just fine on 2.5.18 but breaks in .19/.20. The script is launched with the same CLI commands I normally use, even puting in a sleep before calling everything else in onStart gets ignored. Same error using the script without an onStart method still NPE pointed at onStart. Not sure what else to test to see where it's coming from.

Perhaps you didn't see my post above. Please download 2.5.21, should work well with norandoms now.

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