Jump to content

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


Nadr0j

Recommended Posts

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!

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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