Lordsthan Posted September 11, 2015 Posted September 11, 2015 (edited) 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: 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 September 11, 2015 by Lordsthan
Extreme Scripts Posted September 11, 2015 Posted September 11, 2015 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 ^_^ 1
Isolate Posted September 11, 2015 Posted September 11, 2015 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 1
fixthissite Posted September 11, 2015 Posted September 11, 2015 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: 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
Lordsthan Posted September 11, 2015 Author Posted September 11, 2015 Thanks for everyone, I managed to fix my script using widgets.