Jump to content

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


Recommended Posts

Posted

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
Posted
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
Posted
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

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...