Jump to content


  • Posts

  • Joined

  • Last visited

  • Feedback


Everything posted by trainux

  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?
  12. Your island code is free, I did not know, I will use it to guide me. Thanks brother.
  13. According to my logic, this fragment should work to talk to an NPC of Tutorial Island. if(dialogues.inDialogue()) { if(!dialogues.isPendingContinuation()) { if(dialogues.clickContinue()) { dialogues.clickContinue(); } } }else { NPC tuto2 = npcs.closest("Survival Expert"); if(tuto2.isVisible()){ tuto2.interact("Talk-to"); }else{ getCamera().toEntity(tuto2); } } But in Tutorial Island the annoying messages appear that seem to dialogue with another NPC but they are not. I attach the image specifying the message to which I refer. https://photos.app.goo.gl/3ta5FZpqZNg8EfSM6
  14. How are they used? Could you do an example, please?
  15. I interact with a door, I open it if it is closed, but if this other gate is closed then it interacts with all the doors, I need it to be a specific door. final int[] list = new int[] {1560, 1558}; final RS2Object gate = objects.closest(list); if(gate.exists()) { interactCustom(gate, "Open"); getWalking().walk(new Position(3180, 3288, 0)); }else{ getWalking().webWalk(new Position(3088, 3235, 0)); }
  16. You can see the command and the error: https://photos.app.goo.gl/HTI7gfI3lOoCgFZr1
  17. Thanks for the reply but sorry, error in the writing of the post. The command that I try to execute does not take space. I rewrite the command: java -jar "osbot 2.5.8.jar" -debug 5005 -login user@gmail.com:pass -bot user@gmail.com:pass:0000 -world 394 -script FishingBot:none -allow norandoms,lowresource
  18. If I execute this command to boot osBot, it throws this error: java -jar "osbot 2.5.8.jar" -debug 5005 -login user@gmail.com:pass -bot user@gmail.com:pass:0000 -world 394 -script FishingBot:none -allow norandoms,lowresource The console sends the following error: bot exited with code: 0 If I execute this other command to start everything is perfect: java -jar "osbot 2.5.8.jar" -debug 5005 -login user@gmail.com:pass -bot user@gmail.com:pass:0000 -world 394 -script FishingBot:none -allow norandoms I need the command "lowresource"
  19. Thank you very much. And thank you all for answering.
  20. I do not know if I'll ask a stupid question, but ignoring all NPCs is not a bit obvious that it's a bot? One playing dismisses 2/3 NPC ramdoms.
  21. I did not know it 1) An NPC appears but you can not identify if you want to interact with me or are interacting with another character. 2) The custom of programming of administrative systems I generate a compulsive obsecion of everything programmed by the identifiers (seriously, I do not joke xD) 3) I did not know it. What is it and how do I use it? NOTE: I do not know if it is completely understood because I speak Spanish and use "Google Translate" to try to communicate my doubts.
  • Create New...