-
Posts
240 -
Joined
-
Last visited
-
Feedback
100%
Everything posted by BravoTaco
-
Could of been a server restart/crash that caused the account to logout than once the bot tried re-logging the bot was unable to since the server was unresponsive at the time, causing the bot to quit the script.
-
sudo apt-get install openjdk-8-jdk
-
To my knowledge, you won't be able to override the default mouse movement/interactions within the API so you will have to create custom methods and call those. You wont have to create that many methods as the objects you interact with always have an X, Y position, knowing this you could create a moveMouse(int X, int Y) method that would work for all interactable objects. Than after using your own mouse movement logic to move closely to the object you could than finish off the method with an interaction() call to the API. This may even provide more randomness to the mouse logic since the API will than have a chance to also use its own movement logic to interact with the object.
-
Best way would be to write your own algorithm. You could take a look at this its written in Pascal so you won't be able to just plop into java, but the algorithm is there for you to take a look at than write your own based on that knowledge. It has pretty good functionality such as overshooting the target, shaky pathing to target, and variable speed, to just name a few.
-
Use an array that contains start/end positions of each obstacle that is than linked to the next obstacle. Than you would just need to write navigation logic to run through the course.
-
Is there any way to customize some built-in timers?
BravoTaco replied to vlad3921's topic in Scripting Help
This will right click an entity and click the action. You can add sleeps wherever you would like. You can also add offsets to the mouse position so that it is more randomized. private boolean customRightClickInteract(Entity entity, String interaction) throws InterruptedException { if (entity != null && entity.hover()) { // Right clicks the entity. getMouse().click(true); // This creates a temporary actionOption to later hold the actual option. Option actionOption = null; // This loops through all the active options on the screen and checks to see if // any match the interaction string. // It also increases the index so that it can later be used to grab the correct // rectangle from the option. int index = 0; for (Option option : getMenuAPI().getMenu()) { if (option.action.toLowerCase().equalsIgnoreCase(interaction.toLowerCase())) { actionOption = option; break; } index++; } if (actionOption != null) { // Moves the mouse to the designated action. You should probably give offsets // to the rec.getCenterX() and the rec.getCenterY() so that it doesn't always // go to the center of the text. The y will only be able to have an offset // of around -3 - 3 or so. // The x should be able to handle more maybe -15 - 15? You will have to // mess around with it. Rectangle rec = getMenuAPI().getOptionRectangle(index); getMouse().move((int) rec.getCenterX(), (int) rec.getCenterY()); return getMouse().click(false); } } return false; } -
Hmm interesting, you would only need like 10 lines of code to do this. private void hopWorldsAndSayText(String text, boolean useF2PWorlds) { if (useF2PWorlds) { if (getWorlds().hopToF2PWorld()) { getKeyboard().typeString(text, true); } } else { if (getWorlds().hopToP2PWorld()) { getKeyboard().typeString(text, true); } } }
-
Aaaah to see each item inside the list you will have to loop through it and print each element. You might have to check if there is more than one entity in the list, if their is than use the interact() method to interact, if not than you can just left click normally. You can also move the camera instead if an entity in the list is not the same position as the NPC, as this would imply that the only reason the other entity is in the list is because of camera position and not because two entitys are stacked.
-
How are you looping through the list to print the entitys? For spam clicking an npc you can grab their bounding box and check if the mouse is within that than, just use mouse.click() else move the mouse to the npc. Or you can try the hover() method instead of grabbing the bounding box. It might move the mouse though even if its already hovering, kinda like the interact() method. Haven't tested. This wont work well with moving npcs. NPC npc = getNpcs().closest("Banker"); boolean isMouseOverNPC = (npc != null) && npc.getModel().getBoundingBox( npc.getGridX(), npc.getGridY(), npc.getZ()).contains(getMouse().getPosition()); if (isMouseOverNPC) getMouse().click(false); else if (npc != null) npc.hover();
-
Yeah for any banks not in that class you will have to create a new object that contains the area information. You can put this into an enum or you can create a class that extends from the Banks class so you don’t have to call two separate things to get all the banks.
-
You can access some predefined banks through the API by calling Banks EX. Area varrockWestBank = Banks.VARROCK_WEST; Area[] banks = {Banks.VARROCK_EAST, Banks.VARROCK_WEST, Banks.AL_KHARID, Banks.DRAYNOR}; It has most of the banks in that class. If you need to add banks you could create a class that extends from Banks than just add custom bank locations like so. import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.map.constants.Banks; public final class BanksExtended extends Banks { public static final Area CUSTOM_BANK = new Area(0, 0, 0, 0); }
-
Script causing insane lag, gets worse over time until it crashes
BravoTaco replied to Brian's topic in Scripting Help
You could also try getKeyboard().typeString("Z", false) -
How to disable quest and inventory seaching in webwalk
BravoTaco replied to Algo88's topic in Scripting Help
No way to turn those things off, as the WebWalker requires those things to calculate the best path. Only way around it is to use a WalkingEvent with position[] to walk with. -
Script causing insane lag, gets worse over time until it crashes
BravoTaco replied to Brian's topic in Scripting Help
Try changing from typing a key to just moving the camera randomly. -
Script causing insane lag, gets worse over time until it crashes
BravoTaco replied to Brian's topic in Scripting Help
Very odd. As the random() method just uses the Random class from java. But atleast its working now -
Script causing insane lag, gets worse over time until it crashes
BravoTaco replied to Brian's topic in Scripting Help
Mirror mode or stealth? Also what OS you using? I've ran your code for about 10 mins now, on mirror mode. The fps is still at the max amount of 50. Try running simplified blocks, and slowly start adding in more code to see when it starts happening. -
Links are at the top of the thread.
- 17 replies
-
I recommend what Ace99 said, learning the swing library will come in handy alot. You can also use the class in java called JOptionPane. It allows you to show a dialog rather quickly. The bank names will need to match the order of the banks areas. private Area[] allBanks = new Area[]{Banks.AL_KHARID, Banks.GRAND_EXCHANGE, Banks.LUMBRIDGE_UPPER, Banks.VARROCK_EAST, Banks.VARROCK_WEST}; private String[] bankNames = new String[]{"Al-Kharid", "Grand Exchange", "Lumbridge Upper", "Varrock East", "Varrock West"}; int chosenOption = JOptionPane.showOptionDialog(getBot().getCanvas(), "Select location", "Location Selector", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, bankNames, bankNames[0]); if (chosenOption != -1) getWalking().webWalk(allBanks[chosenOption]);
-
Got an alpha version up. It doesn't have p2p fish added yet, working on it though.
- 17 replies
-
Thanks. If you want a fishing script I could probably have one made up by the end of tomorrow. Maybe replace this one.
- 17 replies
-
Aaaah, well than Timers and custom class. Let me know if you need help with it.
-
Surprised this still works lmao. This was like my second script I wrote. I can make that small change to the script, I'll try to get it done by tomorrow. EDIT: Just realized I no longer have the source code for this... rip.
- 17 replies
-
Its all good. Are you the creator of the script that you are using?
-
Hmmm so you are wanting to run 6 accounts for 4 hours than switch to the other 6 accounts for 4 hours, and loop again? Your second sentence has me a tad confused though. It seems that the VPS you are using can only run 2 accounts at one time. So with this, I'm not sure how you are running the other 4 accounts to equal to the wanted 6 to be ran. Unless you are running 2 accounts at one time for 4 hours and repeating that 2 more times to equal to a total of 6 ran accounts. After which you would like to start the same process but with the other batch of accounts? Than once those accounts have completed their turns. You want it to than reset back to the original batch of accounts and repeat? If so, and you are the one who wrote the script, than the solution is rather easy. Timers and a custom class. Create a class that stores the accounts information that each client will be using. Create a timer that after 4 hours of runtime, you logout of the current account and use the next account information. Once you reach the last stored account information just loop back to the beginning.