Question Getting item prices from the grand exchange

Discussion in 'Developer Support' started by McMitch, Sep 21, 2015.

  1. So it is a simple question but, maybe due to my inexperience in Java, but I can't figure out how to get the price of an item.

    The documentation says there is a getPrice function in the GrandExchange.Item class.
    So I have this code:
    Code (Text):
    1. int lobsterPrice = GrandExchange.Item.getPrice();
    But I'm not really sure how to use it. I assumed I should change this to resemble
    Code (Text):
    1. int lobsterPrice = GrandExchange.Item.ITEMNAME.getPrice();

    Code (Text):
    1. int lobsterPrice = GrandExchange.Item.getPrice(ITEMNAME);
    But I am getting this error
    So what instance do I need to create to use that function?

    Any help would be greatly appreciated,
  2. I can't seem to see that...

    So now I have this
    Code (Text):
    1. Item lobster = GrandExchange.lookup(377);
    2. int lobsterPrice = lobster.getPrice();
    Will this do the trick?

    Thanks for the reply by the way.
  3. I think it does. Just test and see if it works. ;)
    McMitch likes this.

Share This Page