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

Question Getting item prices from the grand exchange

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

  1. McMitch

    Joined:
    Sep 11, 2015
    Messages:
    3
    Likes Received:
    0
    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();
    or

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

    Any help would be greatly appreciated,
    Thanks
     
  2. Derk

    Derk 12 year old normie

    Joined:
    Jan 8, 2015
    Messages:
    2,766
    Likes Received:
    1,339
  3. McMitch

    Joined:
    Sep 11, 2015
    Messages:
    3
    Likes Received:
    0
    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.
     
  4. Derk

    Derk 12 year old normie

    Joined:
    Jan 8, 2015
    Messages:
    2,766
    Likes Received:
    1,339
    I think it does. Just test and see if it works. ;)
     
    McMitch likes this.

Share This Page

Loading...