Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Question [OSRS] How to use the Shop API?

Joined
Dec 3, 2015
Messages
2
I'm trying to make a bot that buys stuff from a shop, then switches worlds once it's done, then a few other things. I'll worry about the rest later, right now I'm stuck at buying things.

I figured out how to get the InterfaceComponent that I need using:
Code:
InterfaceComponent itemInterface = Interfaces.newQuery().names("Item Name").results().first();
once I make sure that the shop's interface is open.

The problem with that is I have no idea how to get the stock of the item. I've gone through as much of the API as I think is applicable and I couldn't find anything except the Shop class. However, when I do anything with it, even just a simple
Code:
if (Shop.isOpen()) { //doStuff }
I get either an ArrayIndexOutOfBounds or NullPointer exception.

I just started trying to write bots for RuneMate today, so I'm pretty sure that I'm using this completely wrong. Anyone know what I'm screwing up on?
 
Nevermind, I took a look at the Shop class and found:
Code:
public static boolean isOpen() {
return Environment.isRS3()?IIIIiIiIiIII.class():iIIiiIiiiIii.do();
}
so I'm assuming the Shop API is for RS3 only. Is there any way to get the stock of a shop item in OSRS?
EDIT: Wait, I'm an idiot that's an if/else thing. I take back what I said about it being RS3 only.
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
The API for that may be outdated unfortunately, it'll be some time before it can be resolved :/
 
Joined
Dec 3, 2015
Messages
2
Alright. Is there any way to get the stock of an item in the shop? I'm not sure what to use or where that data is stored.
 
Top