Skip to content

feat(walker): auto-solve the Draynor Manor (Ernest the Chicken) basement lever puzzle#1810

Open
bgatfa wants to merge 1 commit into
chsami:developmentfrom
bgatfa:feat/draynor-basement-autosolve
Open

feat(walker): auto-solve the Draynor Manor (Ernest the Chicken) basement lever puzzle#1810
bgatfa wants to merge 1 commit into
chsami:developmentfrom
bgatfa:feat/draynor-basement-autosolve

Conversation

@bgatfa

@bgatfa bgatfa commented Jun 27, 2026

Copy link
Copy Markdown

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_BLOCK in the static collision map and weren't
transports, so the pathfinder saw the whole maze as walls → UNREACHABLE → the
walker dead-reckoned into a wall and clicked it.

How it works

  • Door transports (transports.tsv, 9 doors × 2 dirs): Open;Door;<id>
    with a Varbits condition = the lever combo that unlocks the door (varbits
    1788–1793). A transport is a pathfinder edge, so it crosses the static wall;
    PathfinderConfig.useTransport() activates it only when the varbits match and
    Rs2Walker.handleObject opens the now-"Open" door.
  • DraynorBasementSolver (hooked at Rs2Walker.processWalk): when the
    target 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.
  • Endpoints/combos were calibrated live (edge-aware collision flood-fill + the
    wiki lever table) and each door validated by routing through it.

Testing

  • Live: entrance → oil room (deepest, full 9-lever solve) ARRIVES; E/F → oil
    ARRIVES; Start-path to E/F, C/D, N-/S-/SW-small all ARRIVE.
  • Non-basement routing unaffected (the hook is bounds-guarded, transports are
    basement-varbit-gated) — tree-avoidance baseline unchanged.

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1c6789e5-aab7-4ef1-8de3-8974e2a7485f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

DraynorBasementSolver was added to detect Draynor basement targets, model basement rooms/levers/doors, and solve the lever puzzle by searching room-and-combo states. solveIfNeeded(target) runs only when the client is logged in and the player is in the basement, then replans through lever pulls and door crossings. Rs2Walker.processWalk now invokes it for basement targets and restores the target afterward.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: auto-solving the Draynor Manor basement lever puzzle in the walker.
Description check ✅ Passed The description is directly related to the changeset and accurately explains the walker hook and basement puzzle solver.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between fd57cc1 and e9812ff.

⛔ Files ignored due to path filters (1)
  • runelite-client/src/main/resources/net/runelite/client/plugins/microbot/shortestpath/transports.tsv is excluded by !**/*.tsv
📒 Files selected for processing (2)
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/Rs2Walker.java
  • runelite-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.
@bgatfa bgatfa force-pushed the feat/draynor-basement-autosolve branch from e9812ff to ecfcb66 Compare June 27, 2026 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant