CrashBandiboob Posted November 14, 2019 Share Posted November 14, 2019 I've tried playing around with many of the snippets in the snippet section but just can't seem to get anything working that pulls the price of an item. What I'm trying to do (think I should be doing...) is looking up the item name or ID against the RSBuddy data (https://rsbuddy.com/exchange/summary.json) and then outputting this as an integer. Can anyone point me in the right direction? Quote Link to comment Share on other sites More sharing options...
Gunman Posted November 14, 2019 Share Posted November 14, 2019 @CrashBandiboob If you didn't know OSBot API can do this it's in this section of it https://osbot.org/api/org/osbot/rs07/api/GrandExchange.html But if you didn't wanna use the API then sorry I got no snippet for you. I think the OSBot API uses OSBuddy's GE prices. 1 Quote Link to comment Share on other sites More sharing options...
CrashBandiboob Posted November 14, 2019 Author Share Posted November 14, 2019 Changing source and using the official osrs database. Came across this snippet of code but can't wrap my head around it: private Optional<Integer> getPrice(int id){ Optional<Integer> price = Optional.empty(); try { URL url = new URL("http://services.runescape.com/m=itemdb_oldschool/api/catalogue/detail.json?item=" + id); url.openConnection().setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"); url.openConnection().setUseCaches(true); BufferedReader br = new BufferedReader(new InputStreamReader(url.openConnection().getInputStream())); String[] data = br.readLine().replace("{", "").replace("}", "").split(","); br.close(); price = Optional.of(Integer.parseInt(data[0].split(":")[1])); } catch(Exception e){ e.printStackTrace(); } return price; } Quote Link to comment Share on other sites More sharing options...
CrashBandiboob Posted November 14, 2019 Author Share Posted November 14, 2019 6 minutes ago, Gunman said: @CrashBandiboob If you didn't know OSBot API can do this it's in this section of it https://osbot.org/api/org/osbot/rs07/api/GrandExchange.html But if you didn't wanna use the API then sorry I got no snippet for you. I think the OSBot API uses OSBuddy's GE prices. Oh wow! I should really read through the API doc one of these days.... Quote Link to comment Share on other sites More sharing options...
FuryShark Posted November 15, 2019 Share Posted November 15, 2019 (edited) 21 hours ago, Gunman said: @CrashBandiboob If you didn't know OSBot API can do this it's in this section of it https://osbot.org/api/org/osbot/rs07/api/GrandExchange.html But if you didn't wanna use the API then sorry I got no snippet for you. I think the OSBot API uses OSBuddy's GE prices. That only gets the price of the item your buying/selling in the grand exchange. edit: read post below Edited November 15, 2019 by FuryShark 1 Quote Link to comment Share on other sites More sharing options...
Gunman Posted November 15, 2019 Share Posted November 15, 2019 (edited) 8 hours ago, FuryShark said: That only gets the price of the item your buying/selling in the grand exchange. Not getGrandExchange().getOverallPrice(id of item goes here) It will grab the GE price not what you're buying/selling it for in the GE offer slots. Edited November 15, 2019 by Gunman 2 Quote Link to comment Share on other sites More sharing options...