March 15, 20178 yr 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?
March 15, 20178 yr 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
March 15, 20178 yr If im not mistaken doesn't webwalk already use the fastest method (i.e. teletabs etc) provided you have the materials in your inventory?
March 15, 20178 yr 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
March 16, 20178 yr Author 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, 20178 yr by harrypotter
March 16, 20178 yr 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.
March 16, 20178 yr Author 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!
March 16, 20178 yr Author 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
March 16, 20178 yr 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, 20178 yr by Explv
March 16, 20178 yr Author 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); }
Create an account or sign in to comment