June 24, 20178 yr So I need to figure out how to make use of this: https://osbot.org/forum/topic/115417-item-id-tofrom-name-api-revised-pricelookup-api/#comment-1297366 Difficulty: I don't really know java. Do I need to add a class to my script? Add something to my build path? Could someone please explain to me how to incorporate this into my scripts?
June 24, 20178 yr 40 minutes ago, sudoinit6 said: So I need to figure out how to make use of this: https://osbot.org/forum/topic/115417-item-id-tofrom-name-api-revised-pricelookup-api/#comment-1297366 Difficulty: I don't really know java. Do I need to add a class to my script? Add something to my build path? Could someone please explain to me how to incorporate this into my scripts? It's going to be hard to do stuff like this if you do not understand java. Please consider actually learning Java first
June 24, 20178 yr 1 hour ago, Eagle Scripts said: It's going to be hard to do stuff like this if you do not understand java. Please consider actually learning Java first
June 24, 20178 yr Author I figured it out. Just needed to play with it I guess. 21 minutes ago, Eagle Scripts said: It's going to be hard to do stuff like this if you do not understand java. Please consider actually learning Java first You can't make me!
June 24, 20178 yr If you want something easy just use this: private static int getPrice(final int id){ try { URL url = new URL("http://api.rsbuddy.com/grandExchange?a=guidePrice&i=" + id); URLConnection con = url.openConnection(); con.setUseCaches(true); BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream())); String[] data = br.readLine().replace("{", "").replace("}", "").split(","); return Integer.parseInt(data[0].split(":")[1]); } catch(Exception e){ } return -1; } put in the Item ID when you use it and if the item is tradeable it will return the osb price, if not it will return -1.
Create an account or sign in to comment