1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question [OSRS] How to use the Shop API?

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

  1. riazaku

    Joined:
    Dec 3, 2015
    Messages:
    2
    Likes Received:
    0
    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():iIIiiIiiiIii.do();
    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. Arbiter

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,938
    Likes Received:
    1,266
    @Cloud sounds like broken hook/API?
     
  3. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    The API for that may be outdated unfortunately, it'll be some time before it can be resolved :/
     
  4. riazaku

    Joined:
    Dec 3, 2015
    Messages:
    2
    Likes Received:
    0
    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

Loading...