harrypotter Posted March 15, 2017 Share Posted March 15, 2017 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? Quote Link to comment Share on other sites More sharing options...
Explv Posted March 15, 2017 Share Posted March 15, 2017 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 2 Quote Link to comment Share on other sites More sharing options...
Muffins Posted March 15, 2017 Share Posted March 15, 2017 If im not mistaken doesn't webwalk already use the fastest method (i.e. teletabs etc) provided you have the materials in your inventory? Quote Link to comment Share on other sites More sharing options...
whipz Posted March 15, 2017 Share Posted March 15, 2017 24 minutes ago, Muffins said: If im not mistaken doesn't webwalk already use the fastest method (i.e. teletabs etc) provided you have the materials in your inventory? Yes but, you need to setup walking event and set teleports to true 1 Quote Link to comment Share on other sites More sharing options...
Alek Posted March 15, 2017 Share Posted March 15, 2017 All good answers. Quote Link to comment Share on other sites More sharing options...
Juggles Posted March 16, 2017 Share Posted March 16, 2017 Sleep until you are in the new area then call webWalk Quote Link to comment Share on other sites More sharing options...
harrypotter Posted March 16, 2017 Author Share Posted March 16, 2017 (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 March 16, 2017 by harrypotter Quote Link to comment Share on other sites More sharing options...
Explv Posted March 16, 2017 Share Posted March 16, 2017 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. 1 Quote Link to comment Share on other sites More sharing options...
harrypotter Posted March 16, 2017 Author Share Posted March 16, 2017 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 I'll correct that and test, thanks again! Quote Link to comment Share on other sites More sharing options...
harrypotter Posted March 16, 2017 Author Share Posted March 16, 2017 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 Quote Link to comment Share on other sites More sharing options...
Explv Posted March 16, 2017 Share Posted March 16, 2017 (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 March 16, 2017 by Explv Quote Link to comment Share on other sites More sharing options...
harrypotter Posted March 16, 2017 Author Share Posted March 16, 2017 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); } 1 Quote Link to comment Share on other sites More sharing options...