Jump to content

BravoTaco

Scripter II
  • Posts

    237
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by BravoTaco

  1. 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.
  2. 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.
  3. 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; }
  4. 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); } } }
  5. 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.
  6. 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();
  7. 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.
  8. 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); }
  9. 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.
  10. Try changing from typing a key to just moving the camera randomly.
  11. Very odd. As the random() method just uses the Random class from java. But atleast its working now
  12. 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.
  13. 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]);
  14. Got an alpha version up. It doesn't have p2p fish added yet, working on it though.
  15. Thanks. If you want a fishing script I could probably have one made up by the end of tomorrow. Maybe replace this one.
  16. Aaaah, well than Timers and custom class. Let me know if you need help with it.
  17. 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.
  18. Its all good. Are you the creator of the script that you are using?
  19. 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.
  20. Np. Feel free to pm me if ya need help with anything else
  21. For it trying to click the next interaction before the last interaction is done. You will have to modify the useCurrentObstacle() method to accommodate for this. Try adding a check to see if the player is animating before returning true. Ex.
  22. I would recommend when doing agility scripts to make it more task based. Or checkpoint based. IE remember the last obstacle you used, than with that knowledge move onto the next obstacle until interacting with it is successful than set that obstacle as the last completed obstacle and repeat. The example below will have to be restructured as I have no clue in what order the obstacle were going to be performed, nor did I know if that is all the obstacles. As for it not interacting with the second tree branch. The current way you have the variables being set is one after the other. So the second tree branch might not be available as it is not loaded yet or some other issue. Try after interacting with the first branch, use a conditional sleep to set the second branch with a max time-out of like 10 seconds.
×
×
  • Create New...