Jump to content

Walking to an exact position


Recommended Posts

Posted (edited)

I noticed when webwalking it wouldn't go to the exact position I wanted (A few tiles off sometimes) so I did a search to try and figure out how to do this and found a snippet from @@Explv

WalkingEvent walkingPath = new WalkingEvent(position);
                walkingPath.setMiniMapDistanceThreshold(0);
                walkingPath.setMinDistanceThreshold(0);
                execute(walkingPath);

Upon testing this code in my script I still encountered the same problem.

 

Is there another workaround for this?

 

Did you also take a look at the issue @@Alek

 

http://osbot.org/forum/topic/90020-walking-to-a-specific-tile/

 

 

Thank you

Edited by dontbuzz
Posted (edited)

That is WalkingEvent, not WebWalkEvent.

 

I don't want to webwalk anymore cause I saw it had a min distance threshold of 2 or something.

 

 

Shouldn't this code by itself walk to the exact position I choose?

 

I'm confused haha and still learning

WalkingEvent walkingPath = new WalkingEvent(position);
                walkingPath.setMiniMapDistanceThreshold(0);
                walkingPath.setMinDistanceThreshold(0);
                execute(walkingPath);
Edited by dontbuzz
Posted

 

You can use this to click one a specific tile if the tile is visible on your minimap already. 

Position PositionToWalkTo = new Position(0,0,0);



MiniMapTileDestination Spot = new MiniMapTileDestination(getBot(), PositionToWalkTo);

getMouse().click(Spot);

 

I tried this earlier aswell but it still missed the tile sometimes :(

Posted
    public static boolean walkExact(Script script, Position position) {
        WalkingEvent event = new WalkingEvent(position);
        event.setMinDistanceThreshold(0);
        return script.execute(event).hasFinished();
    }

use dis. 

 

 

THIS ACTUALLY WORKED THANKS.

 

I had deleted my script folder accidentally just before i tried this and found out i was still running the non-updated version of my script somehow. 

  • 5 years later...
Posted
On 8/11/2016 at 3:00 AM, Transporter said:
    public static boolean walkExact(Script script, Position position) {
        WalkingEvent event = new WalkingEvent(position);
        event.setMinDistanceThreshold(0);
        return script.execute(event).hasFinished();
    }

use dis. 

 

 

This works but the script for some reason pauses for 1-2 seconds after executing the event. I am running my script in mirror mode

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...