Temsei Posted January 5, 2017 Share Posted January 5, 2017 (edited) Thanks for the tutorial! How could I identify what ground item has been picked up and get the price of that item using this? I have an array of items the script picks up but haven't been able to figure out how exactly to document the profit being made.. EDIT: NVM, got it. Edited January 6, 2017 by Temsei Quote Link to comment Share on other sites More sharing options...
Adept Posted February 21, 2017 Share Posted February 21, 2017 (edited) I'm making use of the ExchangeItem.java class multiple times throughout my code. On some occasions, fetching the price works and other times all price checks simply return 0. Here's an example of price checks which return 0: Item[] inventoryItems = getInventory().getItems(); int j; for(j = 0; j < inventoryItems.length; j++){ Item currentItem = inventoryItems[j]; if (currentItem != null) { log("currentItem: " + currentItem.toString()); int jId = currentItem.getId(); String jName = currentItem.getName(); ExchangeItem jItem = new ExchangeItem(jName, jId); int jPrice = jItem.getPrice(); log("Price: " + jPrice); //returns 0 } } Log example: [INFO][Bot #1][02/22 12:54:38 AM]: currentItem: Item id: 995, Name: Coins, Amount: 8000 [INFO][Bot #1][02/22 12:54:38 AM]: Price: 0 [INFO][Bot #1][02/22 12:54:38 AM]: currentItem: Item id: 12288, Name: Mithril platebody (t), Amount: 1 [INFO][Bot #1][02/22 12:54:38 AM]: Price: 0 [INFO][Bot #1][02/22 12:54:38 AM]: currentItem: Item id: 1051, Name: Santa hat, Amount: 17 [INFO][Bot #1][02/22 12:54:39 AM]: Price: 0 [INFO][Bot #1][02/22 12:54:39 AM]: currentItem: Item id: 6740, Name: Dragon axe, Amount: 11 [INFO][Bot #1][02/22 12:54:39 AM]: Price: 0 Why is this happening? Edited February 22, 2017 by Adept Quote Link to comment Share on other sites More sharing options...
Explv Posted February 22, 2017 Author Share Posted February 22, 2017 (edited) 13 hours ago, Adept said: I'm making use of the ExchangeItem.java class multiple times throughout my code. On some occasions, fetching the price works and other times all price checks simply return 0. Here's an example of price checks which return 0: Item[] inventoryItems = getInventory().getItems(); int j; for(j = 0; j < inventoryItems.length; j++){ Item currentItem = inventoryItems[j]; if (currentItem != null) { log("currentItem: " + currentItem.toString()); int jId = currentItem.getId(); String jName = currentItem.getName(); ExchangeItem jItem = new ExchangeItem(jName, jId); int jPrice = jItem.getPrice(); log("Price: " + jPrice); //returns 0 } } Log example: [INFO][Bot #1][02/22 12:54:38 AM]: currentItem: Item id: 995, Name: Coins, Amount: 8000 [INFO][Bot #1][02/22 12:54:38 AM]: Price: 0 [INFO][Bot #1][02/22 12:54:38 AM]: currentItem: Item id: 12288, Name: Mithril platebody (t), Amount: 1 [INFO][Bot #1][02/22 12:54:38 AM]: Price: 0 [INFO][Bot #1][02/22 12:54:38 AM]: currentItem: Item id: 1051, Name: Santa hat, Amount: 17 [INFO][Bot #1][02/22 12:54:39 AM]: Price: 0 [INFO][Bot #1][02/22 12:54:39 AM]: currentItem: Item id: 6740, Name: Dragon axe, Amount: 11 [INFO][Bot #1][02/22 12:54:39 AM]: Price: 0 Why is this happening? The item IDs are different to on rsbuddy (where I am getting the data from) On rsbuddy Mithril platebody(t) is 12287 for example. You should make use of the RSExchange class I wrote on the first page, passing the names of the items, to ensure that the correct IDs are used. Edited February 22, 2017 by Explv Quote Link to comment Share on other sites More sharing options...
Adept Posted February 22, 2017 Share Posted February 22, 2017 3 hours ago, Explv said: The item IDs are different to on rsbuddy (where I am getting the data from) On rsbuddy Mithril platebody(t) is 12287 for example. You should make use of the RSExchange class I wrote on the first page, passing the names of the items, to ensure that the correct IDs are used. What a silly goose I am. I was passing the ID's of the noted version. RSbuddy needs the IDs of the unnoted version. One can avoid using the other class you provided by simply finding the unnoted ID's using the getUnnotedID() method. Thanks for your help Quote Link to comment Share on other sites More sharing options...
Explv Posted February 22, 2017 Author Share Posted February 22, 2017 22 minutes ago, Adept said: What a silly goose I am. I was passing the ID's of the noted version. RSbuddy needs the IDs of the unnoted version. One can avoid using the other class you provided by simply finding the unnoted ID's using the getUnnotedID() method. Thanks for your help Ah noted id, that makes sense Quote Link to comment Share on other sites More sharing options...
noidlox_ban_9 Posted June 26, 2017 Share Posted June 26, 2017 How would I get the highest and lowest price? @Explv Quote Link to comment Share on other sites More sharing options...
fonchox1 Posted October 18, 2017 Share Posted October 18, 2017 Nice script Quote Link to comment Share on other sites More sharing options...
Titan Rs Posted September 12, 2018 Share Posted September 12, 2018 Hi @Explv, thanks for the snippet, Map<String, ExchangeItem> exchangeItems = new RSExchange().getExchangeItems("Lobster",weapon(),ammo(),"Amulet of glory(6)","Ranging potion(4)"); rangingPotPrice = exchangeItems.get("Ranging potion(4)").getSellAverage()) This returns -1 sometimes and the correct answer othertimes, Its 50/50, am i doing something wrong Quote Link to comment Share on other sites More sharing options...
ProjectPact Posted September 12, 2018 Share Posted September 12, 2018 (edited) 2 hours ago, Luke Reading said: Hi @Explv, thanks for the snippet, Map<String, ExchangeItem> exchangeItems = new RSExchange().getExchangeItems("Lobster",weapon(),ammo(),"Amulet of glory(6)","Ranging potion(4)"); rangingPotPrice = exchangeItems.get("Ranging potion(4)").getSellAverage()) This returns -1 sometimes and the correct answer othertimes, Its 50/50, am i doing something wrong No, you aren’t doing anything wrong. Sometimes if the price has not updated, being that an item has not been purchased to record data, on OSBuddy in the past 15 minutes (don’t quote me on that exactly, but it is within a specific time frame), the last cached value gets reset to a non existent price (-1). You should multi-cach these values, and have a static backup to reference to. Or you could create a method to obtain the buy-sell prices and go off of those. EDIT: Another thing you could do is do is try grabbing prices off of RuneScape’s GE database as a backup. Lots of things you can try! Hope this helps! Edited September 12, 2018 by ProjectPact 1 Quote Link to comment Share on other sites More sharing options...
OCOWA Posted September 16, 2019 Share Posted September 16, 2019 Hmm, no matter what I do, what item, I always get -1 and 0 for all the values. Is there some reason it could be refusing the connection or something? Quote Link to comment Share on other sites More sharing options...
Camaro Posted October 23, 2019 Share Posted October 23, 2019 (edited) Has anyone found a new link? Edited October 26, 2019 by camaro 09 Quote Link to comment Share on other sites More sharing options...