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.

NullPointerException when using store.interact or store.buy

Featured Replies

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

It's an API Null pointer not a error with your script logic. I would suggest maiing your own methods and not using the OSBot API if you find something that has issues with it ^_^

I don't think there's a method for store interacting slot,

It's either item id or item name, since there's no item with the id 8 it's freaking out

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 :)

Create an account or sign in to comment

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.