November 14, 20196 yr 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?
November 14, 20196 yr @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.
November 14, 20196 yr Author 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; }
November 14, 20196 yr Author 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....
November 15, 20196 yr 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, 20196 yr by FuryShark
November 15, 20196 yr 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, 20196 yr by Gunman
Create an account or sign in to comment