Jump to content

Get G.E Data


Jack Shep

Recommended Posts

15 hours ago, Sonysi said:

Just go with this - 

It's more recent and should work. I was having issues with the thread you posted as well.

Thanks, I used their code to get the price for a dragon chainbody (like they do in their post) but the console output was: core.RSBuddyExchangePrice@7946e1f4

Any idea on what I'm doing wrong? This is the full code

public static void main(String[] args) throws IOException {
        
        RSBuddyExchangeOracle.retrievePriceGuide();

        // ...
        RSBuddyExchangePrice price;

        price = RSBuddyExchangeOracle.getItemByName("Dragon chainbody");
        System.out.println(price);
        
    }

12 hours ago, Malcolm said:

getGrandExchange().getOverallPrice(int ID)

If you mix this with 


int itemID = getInventory().getItem("STRING").getId();

Of course this only works if you have one of the items in your inventory and if you're selling the item but its better to not use item IDs but using the string name and getting the ID should be fine.

Other than that if you do choose to use the item ID just know that if Jagex changes the ID it will break the script. 

If you're buying an item you can just do 


getGrandExchange().buyItem(intID, "STRING NAME", (int) getGrandExchange().getOverallPrice(intID), int AMOUNT)) 

I would change the overall price to do +/- a little bit just for leadway. Just multiply or divide the overall price by a little bit and you're likely always going to buy/sell the item 

I tried using the: getGrandExchange().getOverallPrice(int ID) method before and it didn't work. That's why I'm so confused.

Link to comment
Share on other sites

22 minutes ago, NoxMerc said:

You have some fundamental lack of understanding of Java (and/or programming) in general that's going to have you coming back here every other day for help on topics you should already know.

The RSBuddyExchangePrice is an object, not a String.

That's the code the person who released the RSBuddyExchangePrice had on their post, I literally copied and pasted it, and it still didn't work. That's why I continue to have questions.

Link to comment
Share on other sites

6 hours ago, Jack Shep said:

I literally copied and pasted it, and it still didn't work

And you don't know why you think it doesn't work, which is a problem. It probably worked as intended, you're just using it incorrectly. You have an object, not a numeric (int/long) representation of a price.
This is why I said you have a fundamental misunderstanding. That GE Price API gave you back a price object, not a number.

Link to comment
Share on other sites

Sorry that's my fault, I missed out a method in the RSBuddyExchangePrice.java that would translate that squiggly bit of weird text to something that can actually be understood. :)

I've uploaded a fixed version of RSBuddyExchangePrice.java and attached it to the thread: https://osbot.org/forum/topic/150093-rsbuddy-exchange-oracle

 

 

Edited by liverare
Link to comment
Share on other sites

3 hours ago, liverare said:

Sorry that's my fault, I missed out a method in the RSBuddyExchangePrice.java that would translate that squiggly bit of weird text to something that can actually be understood. :)

I've uploaded a fixed version of RSBuddyExchangePrice.java and attached it to the thread: https://osbot.org/forum/topic/150093-rsbuddy-exchange-oracle

 

 

Thank you for the help man, I've been struggling with this for a little while. I really appreciate it

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...