- Thread Author
- #1
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:
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
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:
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.
I figured out how to get the InterfaceComponent that I need using:
Code:
InterfaceComponent itemInterface = Interfaces.newQuery().names("Item Name").results().first();
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 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();
}
EDIT: Wait, I'm an idiot that's an if/else thing. I take back what I said about it being RS3 only.