Jump to content

Web walking


Recommended Posts

Posted (edited)
final int MAX = 4, TIMEOUT = 7000;
for (int i=1; i<=MAX; i++) {
    script.log("Positioner webWalk->" + dest + " try " + i);
    if (!script.walking.webWalk(dest)) {
        script.log("webWalk call failed");
        continue;
    }
    long start = System.currentTimeMillis();
    while (System.currentTimeMillis()-start < TIMEOUT) {
        if (script.myPosition().equals(dest)) {
            script.log("Arrived at tile: " + dest);
            return true;
        }
        script.sleep(150);
    }
    script.log("Timeout at pos: " + script.myPosition());
}
This is what I was attempting


Edited by dynamicagil
Link to comment
Share on other sites

Is the destination very close to where you're starting from?

The call to .webWalk uses a default WebWalkEvent which has an accuracy of +- 4 tiles, so it doesn't go to the exact tile you want. If you need to go to an exact tile, create a WebWalkEvent, and call .setMinDistanceThreshold(0) on the instance before running the event.

Edited by MesonoxScripts
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...