itsdax / Runescape-Web-Walker-Engine

A navigation engine for OSRS written for TriBot
https://tribot.org/
Apache License 2.0
81 stars 37 forks source link

Trying to walk through Al kharid gate without requirements #230

Closed BegTribot closed 10 months ago

BegTribot commented 10 months ago

Inventory: 2 Steel arrow (noted=false) (id=886)

image

[21:00:34] [Walker Engine] PATH_DEBUG[ 3267, 3227, 0) -> OBJECT_BLOCKING -> (3268, 3227, 0) ] [21:00:34] [Walker Engine] Handling Object... [21:00:34] [Object Handler] Detected: Gate Gate [21:00:34] [Object Handler] Sort Order: Gate [Open, Pay-toll(10gp)], Gate [Open, Pay-toll(10gp)], [21:00:35] [Object Handler] Interacting with (Gate) at (3268, 3227, 0) with options: [Pay-toll(10gp)] SUCCESS [21:00:36] [NPC Interaction] Handling... [Sorry, I'm a bit busy., OK then., Yes, don't ask again., Yes., Okay...] [21:00:36] [NPC Interaction] Conversation Options: [Select an Option, Yes, okay., Who does my money go to?, No thank you, I'll walk around.] [21:00:36] [NPC Interaction] Conversation Options: [Select an Option, Yes, okay., Who does my money go to?, No thank you, I'll walk around.] [21:00:36] [NPC Interaction] Conversation Options: [Select an Option, Yes, okay., Who does my money go to?, No thank you, I'll walk around.] [21:00:36] [NPC Interaction] Conversation Options: [Select an Option, Yes, okay., Who does my money go to?, No thank you, I'll walk around.] [21:00:37] [NPC Interaction] Conversation Options: [Click here to continue, Can I come through this gate?] [21:00:37] [NPC Interaction] Clicking continue. [21:00:37] [NPC Interaction] Conversation Options: [Border Guard, Click here to continue, You must pay a toll of ten gold coins to pass.] [21:00:37] [NPC Interaction] Clicking continue. [21:00:38] [NPC Interaction] Conversation Options: [Select an Option, Yes, okay., Who does my money go to?, No thank you, I'll walk around.] [21:00:38] [NPC Interaction] Conversation Options: [Select an Option, Yes, okay., Who does my money go to?, No thank you, I'll walk around.] [21:00:38] [NPC Interaction] Conversation Options: [Select an Option, Yes, okay., Who does my money go to?, No thank you, I'll walk around.] [21:00:38] [NPC Interaction] Conversation Options: [Select an Option, Yes, okay., Who does my money go to?, No thank you, I'll walk around.]

FALSkills commented 10 months ago

The requirements for that gate are configured correctly, your whole path likely included another option that used the necessary gp (such as a ship ride to/from Port Sarim) is my guess. Are you able to reproduce this to prove otherwise? If so, can you please include the web request that generates this path?

PATH_DEBUG[ 3267, 3227, 0) -> OBJECT_BLOCKING -> (3268, 3227, 0) ] is not a configured connection on the back-end as far as I can see, so I'm curious how it would be returning that as your path

BegTribot commented 10 months ago

Daxwalker spammed a bit with "Conversation options" so i'm not able to access the generated path But based on script paint, i'm guessing it was going to alkharid bank but dont know where it started at

I reproduced it with:

  1. start at lumbridge with just 10 coins on inventory
  2. call walker to go to al kharid bank (3270, 3167, 0)
  3. drop coins before getting to the gate
  4. issue reported happens and walker doesn't know how to get out of it and ends up on infinite loop
FALSkills commented 10 months ago

When I asked about reproducing it, I meant under live conditions and not simulating them via dropping the coins. It should not be within the walker's scope to handle user interaction changing the status of the account. The infinite loop is a problem though.

We can handle the infinite loop in a few different ways, but I still would like to answer the question to why it is trying to use a path that does not exist on the back-end. There is no connection between the nodes in your path, (3267, 3227, 0) and (3268, 3227, 0). The connection exists on the tile above them. Are you explicitly passing a path to the walker engine in the original issue? Trying to think of how else that would happen.

For the infinite loop, there is a wait condition that is analyzed after clicking an object to wait for the next furthest tile to update. After that wait condition, regardless of whether it succeeded or not, we return true. I'll make it check the result of that wait and return that. This should then trigger the failure workflow, and after 3 successive failures it should exit the walk. https://github.com/itsdax/Runescape-Web-Walker-Engine/commit/c52659cbcc5dcc0649f4e52280f47cb8aa171859

BegTribot commented 10 months ago

I'm calling walker from GlobalWalking: GlobalWalking.walkTo(new WorldTile(3270, 3167, 0))

I reproduced it without my intervention using the method you described:

  1. use home teleport so it's blocked for 30 mins
  2. get 30 coins (or 60 to pay boat twice) from bank
  3. go to karamja
  4. call GlobalWalking.walkTo(new WorldTile(3270, 3167, 0)) - al kharid bank
  5. gets stuck at al kharid gate (no longer has 10 coins to pay the fee)

[18:48:16] [NPC Interaction] Conversation Options: [Select an Option, Yes, okay., Who does my money go to?, No thank you, I'll walk around.] [18:48:16] [NPC Interaction] Conversation Options: [Select an Option, Yes, okay., Who does my money go to?, No thank you, I'll walk around.] [18:48:16] [NPC Interaction] Conversation Options: [Select an Option, Yes, okay., Who does my money go to?, No thank you, I'll walk around.] [18:48:16] [NPC Interaction] Reached conversation limit. [18:48:16] [Walker Engine] PATH_DEBUG[ 3267, 3228, 0) -> OBJECT_BLOCKING -> (3268, 3228, 0) ] [18:48:16] [Walker Engine] Handling Object... [18:48:16] [Object Handler] Detected: Gate Gate [18:48:16] [Object Handler] Sort Order: Gate [Open, Pay-toll(10gp)], Gate [Open, Pay-toll(10gp)], [18:48:18] [Object Handler] Interacting with (Gate) at (3268, 3227, 0) with options: [Pay-toll(10gp)] SUCCESS

Deaths will probably also work, so any method that loses coins before reaching the final destination

FALSkills commented 10 months ago

The commit linked above should fix the endless loop, and then the walker will generate a new path now knowing that doesn't have enough gp. Should be good enough

BegTribot commented 10 months ago

Yes that should work, thank you