anderiel Posted May 14, 2018 Share Posted May 14, 2018 I was wondering if there is a way to get high alch prices. From an API or something, anything. I have found this : http://forums.zybez.net/runescape-2007-prices/api/rune axe , but all my requests to that site from application end in 503. Quote Link to comment Share on other sites More sharing options...
Nintendo Switch Posted May 14, 2018 Share Posted May 14, 2018 google high alch calculator and you should get some sites that do it for you. 1 Quote Link to comment Share on other sites More sharing options...
anderiel Posted May 14, 2018 Author Share Posted May 14, 2018 13 minutes ago, Nintendo Switch said: google high alch calculator and you should get some sites that do it for you. i kind of hoped for a simpler solution than scraping sites. Quote Link to comment Share on other sites More sharing options...
Plaxonn Posted May 14, 2018 Share Posted May 14, 2018 Very easy dude! Alchmate is the way. I hope I'm not breaking the rules by saying that, no advertisment intended. Quote Link to comment Share on other sites More sharing options...
Alek Posted May 15, 2018 Share Posted May 15, 2018 On 5/14/2018 at 7:06 AM, anderiel said: i kind of hoped for a simpler solution than scraping sites. The simplest solution is just creating an enum and hardcoding the alch values. 22 hours ago, Plaxonn said: Very easy dude! Alchmate is the way. I hope I'm not breaking the rules by saying that, no advertisment intended. He asked for a solution that didn't involve scraping sites Quote Link to comment Share on other sites More sharing options...
Plaxonn Posted May 15, 2018 Share Posted May 15, 2018 On 5/14/2018 at 12:49 PM, anderiel said: I was wondering if there is a way to get high alch prices. From an API or something, anything. I have found this : http://forums.zybez.net/runescape-2007-prices/api/rune axe , but all my requests to that site from application end in 503. Well then he can use OSBuddy. Runelite's API is open source, might be on there. Quote Link to comment Share on other sites More sharing options...
ThatGamerBlue Posted May 15, 2018 Share Posted May 15, 2018 Not sure if OSBot has a getPrice() type function for items (couldn't see it in the API) which would return the item's price in a general store (example from another client), but if it does you can multiply that value by 0.6 for high alch, 0.4 for low alch. 1 Quote Link to comment Share on other sites More sharing options...
anderiel Posted May 16, 2018 Author Share Posted May 16, 2018 18 hours ago, ThatGamerBlue said: Not sure if OSBot has a getPrice() type function for items (couldn't see it in the API) which would return the item's price in a general store (example from another client), but if it does you can multiply that value by 0.6 for high alch, 0.4 for low alch. Nice! This i did not know. Not sure if osbot has such a function, but rsbuddy has api that gives you store prices that i can multiply. I can work with that, thanks. Quote Link to comment Share on other sites More sharing options...
TheMcPker Posted May 16, 2018 Share Posted May 16, 2018 i know you said you don't want to scrap sites but you could make a database on a localhosted website and just loop though all the game's item id's using the site scrapper and that way have a list with alch values you can always use Quote Link to comment Share on other sites More sharing options...
Explv Posted May 16, 2018 Share Posted May 16, 2018 10 hours ago, anderiel said: Nice! This i did not know. Not sure if osbot has such a function, but rsbuddy has api that gives you store prices that i can multiply. I can work with that, thanks. Yes, you can use https://rsbuddy.com/exchange/summary.json Example (using https://github.com/fangyidong/json-simple) import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; public final class AlchValues { private static final float STORE_PRICE_TO_HIGH_ALCH_MULTIPLIER = 0.6f; private static final float STORE_PRICE_TO_LOW_ALCH_MULTIPLIER = 0.4f; private final JSONObject ITEMS_JSON; public AlchValues() throws IOException, ParseException { ITEMS_JSON = getItemsJSON(); } public static void main(String[] args) { AlchValues alchValues = null; try { alchValues = new AlchValues(); } catch (IOException | ParseException e) { System.err.println("Failed to fetch alch values"); System.exit(1); } System.out.println("Yew logs store price: " + alchValues.getStorePrice(1515)); System.out.println("Yew logs high alch: " + alchValues.getHighAlchValue(1515)); System.out.println("Yew logs low alch: " + alchValues.getLowAlchValue(1515)); } private JSONObject getItemsJSON() throws IOException, ParseException { URL url = new URL("https://rsbuddy.com/exchange/summary.json"); URLConnection con = url.openConnection(); con.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"); con.setUseCaches(true); JSONObject itemsJSON; try (InputStreamReader inputStreamReader = new InputStreamReader(con.getInputStream()); BufferedReader bufferedReader = new BufferedReader(inputStreamReader)) { JSONParser jsonParser = new JSONParser(); itemsJSON = (JSONObject) jsonParser.parse(bufferedReader); } return itemsJSON; } public int getHighAlchValue(final int itemID) { return (int) (getStorePrice(itemID) * STORE_PRICE_TO_HIGH_ALCH_MULTIPLIER); } public int getLowAlchValue(final int itemID) { return (int) (getStorePrice(itemID) * STORE_PRICE_TO_LOW_ALCH_MULTIPLIER); } public int getStorePrice(final int itemID) { return Math.toIntExact((long) getItemJSON(itemID).get("sp")); } private JSONObject getItemJSON(final int itemID) { return (JSONObject) ITEMS_JSON.get(String.valueOf(itemID)); } } Output: Yew logs store price: 160 Yew logs high alch: 96 Yew logs low alch: 64 Quote Link to comment Share on other sites More sharing options...