Jump to content

Get G.E Data


Recommended Posts

Posted
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.

Posted
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.

Posted
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.

Posted (edited)

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
Posted
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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