Jump to content

NullPointerException when using store.interact or store.buy


Lordsthan

Recommended Posts

Hey, today I started making my first script and got a bug called NullPointerException when I try to use store.interact or store.buy from OSBot API.

Here's a part of my code:

if(store.isOpen()){
    status = "Buying";
    sleep(random(300,700));
    store.interact(8, "Buy 5");
    //...
}

What I would like to do in-game:

eRZtNqu.png

 

and here is the error:

[ERROR][Bot #1][09/10 10:31:22 PM]: Error in script executor!
java.lang.NullPointerException
	at org.osbot.rs07.api.Store.interact(xi:364)
	at main.onLoop(main.java:82)
	at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(ni:26)
	at java.lang.Thread.run(Unknown Source)

So how could I fix that?

Edited by Lordsthan
Link to comment
Share on other sites

Hey, today I started making my first script and got a bug called NullPointerException when I try to use store.interact or store.buy from OSBot API.

Here's a part of my code:

if(store.isOpen()){
    status = "Buying";
    sleep(random(300,700));
    store.interact(8, "Buy 5");
    //...
}

What I would like to do in-game:

eRZtNqu.png

 

and here is the error:

[ERROR][Bot #1][09/10 10:31:22 PM]: Error in script executor!
java.lang.NullPointerException
	at org.osbot.rs07.api.Store.interact(xi:364)
	at main.onLoop(main.java:82)
	at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(ni:26)
	at java.lang.Thread.run(Unknown Source)

So how could I fix that?

On top of what Divinity said (and as I suggested in the PM), you should check out this thread, which contains custom interaction methods.

 

As you know, I'm not a scripter, so I can't confirm the efficiency of the methods (or if they even work), but it seems like a pretty good place to start.

 

Good luck :)

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