Jump to content

Webwalking error


Recommended Posts

Posted
6 minutes ago, harrypotter said:

inventory.interact("Break", 8007);
getWalking().webWalk(Banks.VARROCK_EAST);

After the tab is clicked I get the following error in log:


WebWalkingEvent; Terminated! Exceeded attempt threshold.

How can I prevent this?

 

Perhaps you should try sleeping until the teleport has completed, for example sleeping until your player is in the destination area

  • Like 2
Posted (edited)
private Area varrockSquare = new Area(3205, 3436, 3221, 3421);
if (inventory.interact("Break", 8007)) {
    new util.Sleep(() -> !varrockSquare.contains(myPosition()), Script.random(1500, 2500)).sleep();
}
getWalking().webWalk(Banks.VARROCK_EAST);

Still gives me the same error, can someone confirm that is correct?

* Using @Explv Sleep class found here: https://osbot.org/forum/topic/115124-explvs-scripting-101/

Edited by harrypotter
Posted
13 minutes ago, harrypotter said:

private Area varrockSquare = new Area(3205, 3436, 3221, 3421);
if (inventory.interact("Break", 8007)) {
    new util.Sleep(() -> !varrockSquare.contains(myPosition()), Script.random(1500, 2500)).sleep();
}
getWalking().webWalk(Banks.VARROCK_EAST);

Still gives me the same error, can someone confirm that is correct?

* Using @Explv Sleep class found here: https://osbot.org/forum/topic/115124-explvs-scripting-101/

Don't you want to sleep until you are in Varrock square? I assume you are using a Varrock teleport. Currently you are sleeping until your player is not in Varrock square, which would mean it wouldn't sleep at all.

  • Like 1
Posted
6 minutes ago, Explv said:

Don't you want to sleep until you are in Varrock square? I assume you are using a Varrock teleport. Currently you are sleeping until your player is not in Varrock square, which would mean it wouldn't sleep at all.

new util.Sleep(() -> varrockSquare.contains(myPosition()), Script.random(1500, 2500)).sleep();

This gives me the same error as well :(

Posted (edited)
1 hour ago, harrypotter said:

new util.Sleep(() -> varrockSquare.contains(myPosition()), Script.random(1500, 2500)).sleep();

This gives me the same error as well :(

Change the sleep timeout to something longer, such as 10000 ms. There isn't much point using a random timeout like you are doing, and 1.5 seconds probably isn't long enough for the teleport to complete.

You should also not just call web walk straight after the teleport. The "Break" interaction could fail, and then your bot will attempt to web walk from wherever your player is standing.

What you should do is something like

If player is in location where you are teleporting from:

Teleport

Else:

Web walk to the bank

 

Alternatively, like other users have suggested you could create a WebWalkEvent which should handle the teleporting for you. Something like:

WebWalkEvent webWalkEvent = new WebWalkEvent(Banks.VARROCK_EAST);

PathPreferenceProfile profile = new PathPreferenceProfile();

profile.checkInventoryForItems(true);

profile.setAllowTeleports(true);

webWalkEvent.setPathPreferenceProfile(profile);

execute(webWalkEvent);

 

Apologies for any syntax errors and the formatting, I'm on my phone

Edited by Explv
Posted
13 minutes ago, Explv said:

Change the sleep timeout to something longer, such as 10000 ms. There isn't much point using a random timeout like you are doing, and 1.5 seconds probably isn't long enough for the teleport to complete.

You should also not just call web walk straight after the teleport. The "Break" interaction could fail, and then your bot will attempt to web walk from wherever your player is standing.

What you should do is something like

If player is in location where you are teleporting from:

Teleport

Else:

Web walk to the bank

Thanks for your help!

I changed to the following which has resolved the issue:

private Area varrockSquare = new Area(3205, 3436, 3221, 3421);
private Area sawmill = new Area(3296, 3495, 3308, 3484);
if (sawmill.contains(myPosition())) {
    if (inventory.interact("Break", 8007)) {
        new util.Sleep(() -> varrockSquare.contains(myPosition()), 10000).sleep();
    }
} else {
    getWalking().webWalk(Banks.VARROCK_EAST);
}

 

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