Jump to content

NPE when attempting to webwalk. First script. Help a newbie


Recommended Posts

Posted

Entire project code

@ScriptManifest(author = "Me", info = "test", logo = "", name = "example script", version = 1)
public class MyScript extends Script {
    @Override
    public int onLoop() throws InterruptedException{
        return 1;
    }

    @Override
    public final void onStart() throws InterruptedException{
        log("Homing");
        Area home = new Area(3249, 3237, 3246, 3240);
        WebWalkEvent webWalkEvent = new WebWalkEvent(home);
        webWalkEvent.execute();
    }
}

Exception

[INFO][Bot #1][10/22 01:15:44 PM]: Homing
[ERROR][Bot #1][10/22 01:15:44 PM]: Error in script onStart(): example script
java.lang.NullPointerException: Cannot invoke "org.osbot.rs07.Bot.getEventExecutor()" because "IiiIIiIiiIi.bot" is null
	at org.osbot.rs07.script.MethodProvider.execute(di:569)
	at MyScript.onStart(MyScript.java:24)
	at org.osbot.rs07.event.ScriptExecutor.iiiIiiIiIII(ch:550)
	at org.osbot.rs07.event.ScriptExecutor.start(ch:366)
	at org.osbot.XB.iiiIIiIiiii(sr:93)
	at org.osbot.cA.iiiIIiIiiii(us:487)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
[INFO][Bot #1][10/22 01:15:44 PM]: Terminating script example script...
[INFO][Bot #1][10/22 01:15:44 PM]: Script example script has exited!

 

Posted (edited)
8 hours ago, Nadr0j said:

Entire project code

@ScriptManifest(author = "Me", info = "test", logo = "", name = "example script", version = 1)
public class MyScript extends Script {
    @Override
    public int onLoop() throws InterruptedException{
        return 1;
    }

    @Override
    public final void onStart() throws InterruptedException{
        log("Homing");
        Area home = new Area(3249, 3237, 3246, 3240);
        WebWalkEvent webWalkEvent = new WebWalkEvent(home);
        webWalkEvent.execute();
    }
}

Exception

[INFO][Bot #1][10/22 01:15:44 PM]: Homing
[ERROR][Bot #1][10/22 01:15:44 PM]: Error in script onStart(): example script
java.lang.NullPointerException: Cannot invoke "org.osbot.rs07.Bot.getEventExecutor()" because "IiiIIiIiiIi.bot" is null
	at org.osbot.rs07.script.MethodProvider.execute(di:569)
	at MyScript.onStart(MyScript.java:24)
	at org.osbot.rs07.event.ScriptExecutor.iiiIiiIiIII(ch:550)
	at org.osbot.rs07.event.ScriptExecutor.start(ch:366)
	at org.osbot.XB.iiiIIiIiiii(sr:93)
	at org.osbot.cA.iiiIIiIiiii(us:487)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
[INFO][Bot #1][10/22 01:15:44 PM]: Terminating script example script...
[INFO][Bot #1][10/22 01:15:44 PM]: Script example script has exited!

 

You should not execute any siuch heavy code that interacts with the game in the onStart method.
It's mainly for initlializing :)

execute(webwalkevent);

Edited by Khaleesi

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...