Jack Shep Posted December 29, 2018 Share Posted December 29, 2018 I'm having some trouble understanding how to properly use this. I'm trying different things but they aren't working. Quote Link to comment Share on other sites More sharing options...
NoxMerc Posted December 29, 2018 Share Posted December 29, 2018 We're not mind readers here. What's not working and what have you tried? Post the complete source of your code. 1 Quote Link to comment Share on other sites More sharing options...
Reminiscence Posted December 29, 2018 Share Posted December 29, 2018 Just go with this - It's more recent and should work. I was having issues with the thread you posted as well. 1 Quote Link to comment Share on other sites More sharing options...
Jack Shep Posted December 29, 2018 Author Share Posted December 29, 2018 On 12/29/2018 at 7:13 AM, Sonysi said: Just go with this - It's more recent and should work. I was having issues with the thread you posted as well. Expand 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); } On 12/29/2018 at 9:48 AM, 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 Expand I tried using the: getGrandExchange().getOverallPrice(int ID) method before and it didn't work. That's why I'm so confused. Quote Link to comment Share on other sites More sharing options...
NoxMerc Posted December 29, 2018 Share Posted December 29, 2018 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. Quote Link to comment Share on other sites More sharing options...
Jack Shep Posted December 30, 2018 Author Share Posted December 30, 2018 On 12/29/2018 at 11:53 PM, 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. Expand 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. Quote Link to comment Share on other sites More sharing options...
NoxMerc Posted December 30, 2018 Share Posted December 30, 2018 On 12/30/2018 at 12:20 AM, Jack Shep said: I literally copied and pasted it, and it still didn't work Expand 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. Quote Link to comment Share on other sites More sharing options...
liverare Posted December 30, 2018 Share Posted December 30, 2018 (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 December 30, 2018 by liverare Quote Link to comment Share on other sites More sharing options...
Jack Shep Posted December 30, 2018 Author Share Posted December 30, 2018 On 12/30/2018 at 3:54 PM, 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 Expand Thank you for the help man, I've been struggling with this for a little while. I really appreciate it Quote Link to comment Share on other sites More sharing options...