Jump to content

Web walking not working for me. WebWalkingEvent; No route found!


wavefloat

Recommended Posts

Hi there. So I've tried to call on web walking a couple different ways. Each time the script gets to the part where a destination is found, it fails to walk there via web walk. Console spits out this error:
 WebWalkingEvent; No route found!

Here's my code, please assist. it'd be greatly appreciated

public void walkCow() throws InterruptedException {
    sleep(2000);

    // Find the nearest cow
    Entity cow = getNpcs().closest("Cow");
    log("Finding cow");

    // Check if a cow is found
    if (cow != null) {
        // Get the position of the cow
        Position cowPosition = cow.getPosition();
        log("Cow located!");

        // Walk to the position of the cow
        if (cowPosition != null) {
            if (getWalking().webWalk(cowPosition)) {
                log("Walking to the cow");
            } else {
                log("Failed to find a route to the cow!");
            }
        }
    } else {
        // If no cow is found, walk to the nearest tree
        RS2Object tree = getObjects().closest("Tree");
        log("No cow found, walking to the nearest tree");

        // Check if a tree is found
        if (tree != null) {
            // Get the position of the tree
            Position treePosition = tree.getPosition();

            // Walk to the position of the tree
            if (treePosition != null) {
                if (getWalking().webWalk(treePosition)) {
                    log("Walking to the tree" + treePosition);
                } else {
                    log("Failed to find a route to the tree! trying again" + treePosition);
                    walkLol();
                }
            }
        } else {
            log("No tree found either. Nowhere to walk!");
        }
    }
}



and here is walkLol
public void walkLol() throws InterruptedException {
    WebWalkEvent walkLol = new WebWalkEvent(new Position(3215, 3456, 0));
    walkLol.useSimplePath();

    execute(walkLol);
    log("im trying lol");


pls help
Link to comment
Share on other sites

16 hours ago, wavefloat said:

Hi there. So I've tried to call on web walking a couple different ways. Each time the script gets to the part where a destination is found, it fails to walk there via web walk. Console spits out this error:
 WebWalkingEvent; No route found!

Here's my code, please assist. it'd be greatly appreciated

public void walkCow() throws InterruptedException {
    sleep(2000);

    // Find the nearest cow
    Entity cow = getNpcs().closest("Cow");
    log("Finding cow");

    // Check if a cow is found
    if (cow != null) {
        // Get the position of the cow
        Position cowPosition = cow.getPosition();
        log("Cow located!");

        // Walk to the position of the cow
        if (cowPosition != null) {
            if (getWalking().webWalk(cowPosition)) {
                log("Walking to the cow");
            } else {
                log("Failed to find a route to the cow!");
            }
        }
    } else {
        // If no cow is found, walk to the nearest tree
        RS2Object tree = getObjects().closest("Tree");
        log("No cow found, walking to the nearest tree");

        // Check if a tree is found
        if (tree != null) {
            // Get the position of the tree
            Position treePosition = tree.getPosition();

            // Walk to the position of the tree
            if (treePosition != null) {
                if (getWalking().webWalk(treePosition)) {
                    log("Walking to the tree" + treePosition);
                } else {
                    log("Failed to find a route to the tree! trying again" + treePosition);
                    walkLol();
                }
            }
        } else {
            log("No tree found either. Nowhere to walk!");
        }
    }
}



and here is walkLol
public void walkLol() throws InterruptedException {
    WebWalkEvent walkLol = new WebWalkEvent(new Position(3215, 3456, 0));
    walkLol.useSimplePath();

    execute(walkLol);
    log("im trying lol");


pls help

If you are going to want to walk to a tile that's unwalkable you might run into these issues.
For exmaple the tree position is obviously unwalkable as it's blocked by the tree.

What you can do to solve this is either get a proper position or create a area around the position and walk to the area instead.

Try something like this:

Position treePosition = tree.getPosition();
Area treeArea = treePosition.getArea(3);
getWalking().webWalk(treeArea);

 

  • Heart 1
Link to comment
Share on other sites

7 hours ago, Khaleesi said:

If you are going to want to walk to a tile that's unwalkable you might run into these issues.
For exmaple the tree position is obviously unwalkable as it's blocked by the tree.

What you can do to solve this is either get a proper position or create a area around the position and walk to the area instead.

Try something like this:

Position treePosition = tree.getPosition();
Area treeArea = treePosition.getArea(3);
getWalking().webWalk(treeArea);

 

you're a beautiful person, code works now. thank you so much

  • Heart 1
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...