trainux
-
Posts
77 -
Joined
-
Last visited
-
Feedback
0%
Posts posted by trainux
-
-
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);
-
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}
-
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?
-
54 minutes ago, FrostBug said:
The login handler seems to pause the ScriptExecutor. This would conflict with the fact that it's also a ResponseCode listener, as the ResponseCode listeners (I believe) are invoked between calls to onLoop (which will not happen when ScriptExecutor is paused).
Perhaps it's outdated.
any solution?
-
7 hours ago, FrostBug said:
Maybe didn't execute the event properly
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.
-
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.
-
On 6/23/2018 at 2:19 AM, progamerz said:
Or, u can just select the item whenever ge is open, assuming its note/stacked, it would automatically set the amount in ge to full.
if(item != null){ //checks and etc. if(item.interact()){ //conditionalsleep } }
Thanks :D
- 1
-
15 minutes ago, Slut said:
re read it, I had to edit it because my web browser is rooted atm.
Yeah! good idea to solve the amount.
Thank you thank you very much. Solved.
-
1 minute ago, Slut said:
Have you tried
grandExchange.sellItem(439, 30, );
Assuming you say "null", then "eclipse" tells me that it is not an allowed parameter.
-
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. -
26 minutes ago, Chris said:
WalkingEvent event = new WalkingEvent(new Position(0,0,0));
event.setMinDistanceThreshhold(0);
execute(event);
Thanks, solved.
-
5 minutes ago, Muffins said:
if the tile is further than 10 spaces (or off of the minimap) you will need to use getWalking().webWalk() instead.
As you can notice, it is only 1 distance coordinate.
1 minute ago, ProjectPact said:need to set threshold to 0 or use minimap on exact tile
I did not understand, could you give a better explanation? please.
-
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?
-
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? -
2 minutes ago, Explv said:
Well firstly @trainux, don't check if getDialogues().inDialogue(), because as you said yourself, the player is always in a dialogue.
Whenever you are talking to an NPC on the island the "Click here to continue" / "Click to continue" widget will be visible. So just check for that instead.
Just look at my open source script https://github.com/Explv/Tutorial-Island
Your island code is free, I did not know, I will use it to guide me.
Thanks brother. -
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.
-
4 minutes ago, Chris said:
Use a filter
How are they used?
Could you do an example, please? -
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)); }
-
You can see the command and the error:
-
17 minutes ago, Lemons said:
Seems you have some extra spaces, try:
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
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
-
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"
-
35 minutes ago, Charlotte said:
Random events were phased out in rs3 as better anti-macro software was developed. Random events have no effect whatsoever and is not used to determine botters. You can either completely ignore it or use the built-in system to dismiss it.
Thank you very much.
And thank you all for answering. -
9 minutes ago, Antonio Kala said:
Are you asking how to know if random event is for you or for another player?
You can just ignore them and they will go away. Or click on settings then tick "dismiss randoms".
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. -
14 minutes ago, Cloxygen said:
u know there is a built in random event handler right?
I did not know it
13 minutes ago, Explv said:1) I have no idea what you're asking
2) Why use IDs for NPCs? It looks horrible, is extremely unreadable (highlighted by the fact that you have comments) You can just use the names of the NPCs...
NPC npc = getNpcs().closest("Giles", "Sandwich Lady", "Rick Turpentine");
etc.
3) OSBot already has a random event dismisser, why are you writing your own?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.
How to get the price of an item in the GE?
in Scripting Help
Posted
thank you very much brother.