skiefboom 0 Posted May 19, 2023 Hi guys, New to creating script and im having a issue with walking, please check video below to see what is happening. fun walkTo(tile: Tile): Boolean { do { if(Walking.shouldWalk(Calculations.random(4, 8))) { Walking.walk(tile) } Sleep.sleepUntil({ !player.isMoving }, 20000) } while (tile != player.tile) return player.tile.equals(tile) } While i am walking the script clicks a few times to walk to the next point, how can i fix this?
Presumptuous 24 Posted May 19, 2023 You could simply use: Walking.walk(tile); Sleep.sleepUntil(()-> Players.getLocal.isMoving(), 2000); Then add an additional sleep to prevent the bot from clicking a new tile after moving. You could add another conditional sleep for if the player isn't moving or if you want it more efficient, add a conditional sleep that calculates distance to the destination so it doesn't have to wait until it stops moving to click again. For instance, I use: Sleep.sleepUntil(()-> Walking.getDestinationDistance() <= 1, 5000); This allows the bot to walk smoothly without stopping or clicking more than it should.
Roused 22 Posted May 22, 2023 I typically like to use Areas when walking - you can use Explv's map to get areas: 1. Go to https://explv.github.io/ 2. Select the settings icon on the right, and change the Bot type to Dreambot 3. Select either the Area (rectangle) or Poly Area (pentagon) icon 4. Click on a spot on the map, then click again to get an area. Then you can copy the output Example Grand Exchange area I grabbed from For example code: private final Area GRAND_EXCHANGE = new Area(3153, 3501, 3177, 3477); private void walkToGE(){ if (!GRAND_EXCHANGE.contains(Players.getLocal()){ //Check if the area contains your player if (!Walking.isRunEnabled() && Walking.getRunEnergy() >= 50) //I like to throw this in in order to enable run if above certain energy (50% here) Walking.toggleRun(); Walking.walk(GRAND_EXCHANGE.getRandomTile()); //Call Walking.walk and pass the area.getRandomTile sleepUntil(() -> GRAND_EXCHANGE.contains(Players.getLocal()); //Sleep until the area contains your player } }
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now