Question [OSRS] How to use the Shop API?

Discussion in 'Developer Support' started by riazaku, Dec 3, 2015.

  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:
    Code (Text):
    1. 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 (Text):
    1. 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?
    --- Double Post Merged, Dec 5, 2015, Original Post Date: Dec 3, 2015 ---
    Nevermind, I took a look at the Shop class and found:
    Code (Text):
    1. public static boolean isOpen() {
    2. return Environment.isRS3()?IIIIiIiIiIII.class();
    3. }
    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.
  2. @Cloud sounds like broken hook/API?
  3. The API for that may be outdated unfortunately, it'll be some time before it can be resolved :/
  4. 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.

Share This Page