feat(walker): auto-solve the Draynor Manor (Ernest the Chicken) basement lever puzzle#1810
feat(walker): auto-solve the Draynor Manor (Ernest the Chicken) basement lever puzzle#1810bgatfa wants to merge 1 commit into
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Walkthrough
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/puzzles/DraynorBasementSolver.java`:
- Around line 249-253: Stop replanning after a failed lever pull by checking
each step in DraynorBasementSolver’s lever-handling path. In the loop that calls
Rs2Walker.walkTo, Rs2GameObject.interact, and sleepUntil around the lever
varbit, verify the walk reached LEVER_TILE[li], the Pull interaction succeeded,
and the varbit actually changed from before; if any step fails, return false or
break so the solver can fall back instead of retrying the same unchanged state.
- Around line 263-276: The `DraynorBasementSolver` logic is using `sleepUntil(()
-> false, ...)` as a fixed delay, which does not wait for any real state change.
Replace these waits with `sleepUntil` predicates tied to actual game-state
transitions in the same flow, such as confirming the player has crossed into the
target room via `roomOf(Rs2Player.getWorldLocation())`, or that the
transport/varbit state has settled before continuing. Use the existing `crossed`
check and the transport handling around `Rs2Walker.walkTo` to anchor the
predicates so the solver only proceeds once movement or room transition is
actually complete.
In
`@runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/Rs2Walker.java`:
- Around line 1060-1062: The basement-solver branch in Rs2Walker is restoring
the original target unconditionally after solveIfNeeded returns, which can
resurrect a walk that was cancelled or replaced while the solver ran. Update the
Rs2Walker target-restoration flow around the
DraynorBasementSolver.isBasementTarget/solveIfNeeded path to verify this walk
still owns the route before calling setTarget, using a cancellation/ownership
token or a solver result that distinguishes internal target clearing from
external cancellation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 723cd58e-be06-4dcc-9454-21132fd5f6f4
⛔ Files ignored due to path filters (1)
runelite-client/src/main/resources/net/runelite/client/plugins/microbot/shortestpath/transports.tsvis excluded by!**/*.tsv
📒 Files selected for processing (2)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/Rs2Walker.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/puzzles/DraynorBasementSolver.java
…-walk A plain Rs2Walker.walkTo / "Start path" to a Draynor Manor (Ernest the Chicken) basement tile used to run into a wall and click it: the 9 puzzle doors are FULL_BLOCK in the static collision map, so the pathfinder treated the whole maze as walls and returned UNREACHABLE. Make any walk to a basement tile solve the puzzle and route there: - Register the 9 puzzle doors as varbit-conditional transports (transports.tsv): Open;Door;<id> gated by the lever varbits 1788-1793 that unlock each door, so the stock walker opens + crosses whichever doors the current lever state allows. A transport is a pathfinder edge, so it bypasses the static wall (same mechanism the normal manor doors already use). - Add DraynorBasementSolver (util/walker/puzzles), hooked at the Rs2Walker.processWalk entry: when the target is a basement tile and the player is in the basement, BFS over (lever-combo x room) for the next action and execute it (pull a lever / cross an unlocked door), re-planning after every step so a lever pull re-locking a door cannot strand the walk. Non-basement walks are untouched (the hook is bounds-guarded; the transports are basement-varbit-gated). Uses gameval ObjectID.LEVERA..F / VarbitID.ERNESTLEVER_A..F.
e9812ff to
ecfcb66
Compare
What
A web-walk ("Start path" /
Rs2Walker.walkTo) to any tile in the Draynor Manor(Ernest the Chicken) basement now solves the 9-door / 6-lever puzzle on its own
and routes to the target.
Why
The 9 puzzle doors are
FULL_BLOCKin the static collision map and weren'ttransports, so the pathfinder saw the whole maze as walls → UNREACHABLE → the
walker dead-reckoned into a wall and clicked it.
How it works
transports.tsv, 9 doors × 2 dirs):Open;Door;<id>with a
Varbitscondition = the lever combo that unlocks the door (varbits1788–1793). A transport is a pathfinder edge, so it crosses the static wall;
PathfinderConfig.useTransport()activates it only when the varbits match andRs2Walker.handleObjectopens the now-"Open" door.DraynorBasementSolver(hooked atRs2Walker.processWalk): when thetarget is in the basement and the player is too, BFS over (lever-combo × room)
returns the next action (pull a lever in this room / cross an unlocked door);
it executes one action, then re-plans — re-planning matters because pulling a
lever re-locks the doors around it, so a fixed plan would strand the walk.
wiki lever table) and each door validated by routing through it.
Testing
ARRIVES; Start-path to E/F, C/D, N-/S-/SW-small all ARRIVE.
basement-varbit-gated) — tree-avoidance baseline unchanged.