Jump to content

Walking to an exact position


dontbuzz

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

 

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 :(

Link to comment
Share on other sites

I tried this earlier aswell but it still missed the tile sometimes sad.png

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

use dis. 

 

 

Edited by Transporter
  • Like 2
Link to comment
Share on other sites

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

use dis. 

 

 

EDIT: THIS WORKED FOR ME

Edited by dontbuzz
Link to comment
Share on other sites

    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. 

Link to comment
Share on other sites

  • 5 years later...
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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