Jump to content

trainux

Members
  • Posts

    77
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

trainux's Achievements

Iron Poster

Iron Poster (3/10)

7

Reputation

  1. I needed something simpler, something to just indicate the ID, thanks for the code fragment and for the advice. Price.java package scripts; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; import java.util.Iterator; import java.util.List; import json.JsonObject; import json.JsonObject.Member; public class Price { private final static String RSBUDDY_URL = "https://rsbuddy.com/exchange/summary.json"; public int getPrice(List<Integer> items) { int price = 0; try { URL url = new URL(RSBUDDY_URL); BufferedReader jsonFile = new BufferedReader(new InputStreamReader(url.openStream())); JsonObject priceJSON = JsonObject.readFrom(jsonFile.readLine()); Iterator<Member> iterator = priceJSON.iterator(); while (iterator.hasNext()) { JsonObject itemJSON = priceJSON.get(iterator.next().getName()).asObject(); int itemID = itemJSON.get("id").asInt(); if (items.contains(itemID)) { price = itemJSON.get("buy_average").asInt(); break; } } } catch (Exception e) { } return price; } } Usage: final Price price = new Price(); ArrayList<Integer> items = new ArrayList<Integer>(); items.add(434); price.getPrice(items);
  2. Using this api as a base I consult as follows (as the post says): rsExchange.getExchangeItem("Yew logs").ifPresent(System.out::println); It works well, but if I consult another item like "Clay" it does not work, the value it brings of the page is "-1" in all prices. I manually check the link and return the json with the prices. http://api.rsbuddy.com/grandExchange?a=guidePrice&i=434 The next json throws me: {"overall":136,"buying":140,"buyingQuantity":33,"selling":136,"sellingQuantity":867}
  3. I have the link "GE" where I get, by Json, the price per ID, of each item, how can I get only the price that said Json contains?
  4. Here as I have the code. LoginEvent loginEvent; @Override public int onLoop() throws InterruptedException{ if(!getClient().isLoggedIn()) { loginEvent = new LoginEvent(usuario,clave); getBot().addLoginListener(loginEvent); execute(loginEvent); }else { doTasks(); } return 1000; } It is assumed that onLoop() is repeated in an interval as indicated in the "return", in this case 1 second.
  5. Error to auto start session with A Simple Login Handler after the connection fell a few seconds. The system initiates session with this API perfectly, but when the connection is dropped and the system is re-established, it does not detect that a user is not logged in and does not perform the auto-login.
  6. Yeah! good idea to solve the amount. Thank you thank you very much. Solved.
  7. Assuming you say "null", then "eclipse" tells me that it is not an allowed parameter.
  8. How to sell the whole amount of an item in the GE? Guiding me from the API GrandExchange Sell Item I try in the following way: grandExchange.sellItem(439, 30, 0); Automatically places to sell a single item. I put "0" at the end, assuming that it interprets that they are all those that are in the inventory. I would like to sell them all in one sale.
  9. As you can notice, it is only 1 distance coordinate. I did not understand, could you give a better explanation? please.
  10. I execute: log(player.getPosition()); it gives me as a result: [x=3172, y=3364, z=0] And I am ordering you to address: [x=3172, y=3365, z=0] As follows: getWalking().walk(new Position(3172, 3365, 0)); Why do not you move to the position that I am ordering?
  11. Make a script that works fishing in Draynor, something simple what you do inside the game. What really makes it "interesting" is that it works random times, rests random times, does not work in the range of 22: 00-6: 00. The times of "rest" can be of 5-30mins, in these times the account is disconnected (using the script "A simple login handler By @Explv" to manipulate the start of the session when you enter working hours). The problem is that when the bot has worked a while (1 day approximately) does not return to log on by itself, I have to press the button to pause the bot and then resume it to return to normal work. Why will this take place?
×
×
  • Create New...