Jump to content

Webwalking error


harrypotter

Recommended Posts

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

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

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

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

Yes you would be correct :facep:

I'll correct that and test, thanks again!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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