Skip to content

2.5.7#1765

Merged
chsami merged 19 commits intomainfrom
development
May 9, 2026
Merged

2.5.7#1765
chsami merged 19 commits intomainfrom
development

Conversation

@chsami
Copy link
Copy Markdown
Owner

@chsami chsami commented May 9, 2026

webwalker improvements

runsonmypc and others added 19 commits April 19, 2026 15:56
TransportNode's constructor was pre-adding previous.cost to travelTime,
then passing that sum as `wait` to Node(WorldPoint, Node, int) — which
re-adds previous.cost. The upshot: any TransportNode chained off another
TransportNode had its cost double-counted. This only surfaced once a
real transport->transport chain became the only viable path (e.g. Map
of Alacrity -> agility shortcut), which is why it stayed latent.

Concrete impact: "go to nearest bank" from outside Nemus retreat picked
Shilo (cost 55) over Nemus (observed 74, should be 40 = 34 MoA + 3
climb + 3 walk). The shortcut's TransportNode was being stamped at g=71
instead of g=37, tripling the cost of every agility-shortcut edge
downstream of a teleport.

Passing the final absolute cost through Node(int, Node, int cost)
instead of the wait-based constructor also sidesteps a second bug: for
plane-crossing transports with travelTime=0 (e.g. Slayer Tower chains),
the wait<=0 branch of Node.cost falls back to
WorldPointUtil.distanceBetween, which returns Integer.MAX_VALUE across
planes — overflowing previousCost + distance into Integer.MIN_VALUE
territory and making those transports look "free". The absolute-cost
path never consults distanceBetween.

Also in this pass:
  - CollisionMap [MoA] debug log: report actual per-transport costs
    instead of the hardcoded `+ 4` (all MoA durations happened to be
    4, but the log was incidental to the value, not tracking it).
  - Rs2Walker.findMoaWidget: token-set membership instead of
    substring match — avoids false positives like token "log"
    matching a hypothetical "logstrum" widget label.
MoaAuditPlugin and the runMoaAudit()/closeMoaWidgetIfOpen() helpers in
Rs2Walker were intended as a temporary offline landing-coord audit tool
(self-labelled [TEMP] "Delete when done") and were supposed to be held
on a separate debug branch, not merged. They slipped into upstream with
PR #1750 because the amend that removed them locally was never pushed
before the PR was merged.

Scope: delete-only. No functional changes to MoA handling —
handleSeasonalTransport, lockedMoaRegions, and blacklistedMoaDestinations
are untouched.
…d guardrail

- collectMoaChildren called getDynamicChildren/getNestedChildren/getStaticChildren
  directly; the static guardrail scanner can't follow through to the callers'
  runOnClientThreadOptional wrappers, so it flagged a new violation.
- Inlined the three child-array fetches into findMoaWidget and
  computeMoaHotkeyByIndex — they now happen inside the client-thread lambda
  where the scanner can see the wrapper.
- Regenerated client-thread-guardrail-baseline.txt: combined effect of the
  MoA edits and the audit-plugin removal shifted pre-existing Rs2Walker
  lambda indices, plus a few entries the old baseline was missing.
Symptom: with Asgarnia MoA region locked, walker runs in a tight loop at
the teleport tile. Each attempt blacklists one destination, re-path picks
a different destination *from the same locked region*, walker tries it,
fails, repeat. Log shows SEASONAL_TRANSPORT usable count steps down per
attempt (122 -> 121 -> 120 -> 119 ...) while src barely moves.

Cause: handleSeasonalTransport already adds the region name to
Rs2Walker.lockedMoaRegions when it detects <str>…</str> markup on the
region row, but PathfinderConfig's MoA filter only checks
blacklistedMoaDestinations (per-destination). Region lock wasn't propagating
to the pathfinder.

Fix: in PathfinderConfig.useTransport's MoA branch, extract the region
segment from the displayInfo ("Map of Alacrity: <Region> - <Name>") and
reject the transport if that region is in lockedMoaRegions.
…meout

handleSeasonalTransport was blacklisting a destination whenever the
post-region-click destination widget didn't appear in 3s. That trigger
is ambiguous: combat, lag, or any other handler closing the widget all
manifest as "never appeared", so e.g. a player getting attacked during
a teleport attempt permanently poisoned that destination for the whole
session. Walker then avoids a legitimate bank forever.

Change: on timeout, just return false and let the pathfinder/walker
retry. Keep positive-evidence blacklisting (<str> markup on the region
or destination row) — those cases actually observe the lock.
… steal

Canvas.setFocusable(true) + Canvas.dispatchEvent triggers the window manager
to grant focus to the game window, stealing it from whatever app the user
was actually typing in. Invoke the canvas's registered KeyListeners directly
instead; keep withFocusCanvas as a no-op wrapper so existing call sites still
compile.
… keypress

After the destination hotkey is pressed, the widget needs a moment to dismiss
and kick off the teleport animation. Without this wait, the caller's
!Rs2Player.isAnimating() check in the walker transport loop passes instantly,
letting the walker race into the next transport step — e.g. clicking Royal
seed pod mid-MoA-teleport, which teleports the player back to Grand Tree and
starts a MoA ↔ seed-pod loop.
Lambda indices in Rs2Walker shifted by 1 after the MoA widget-close wait
added a sleepUntil lambda inside handleSeasonalTransport.
tradablePrimaryId() returned the first tradable ID from ItemCollections,
which could be a league cosmetic (e.g., Trailblazer axe id=20011) priced
at Integer.MAX_VALUE on the Wiki real-time API. This caused
"need 2,147,483,647 gp" errors and blocked quest item acquisition.

Changes:
- tradablePrimaryId(): fetch prices for all tradable variants and pick
  the cheapest, avoiding league/cosmetic items
- fetchInstabuyReferencePrice(): reject prices >= Integer.MAX_VALUE as
  invalid, falling back to -1

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…obot/questhelper/QuestScript.java

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
fix(questscript): avoid league/cosmetic items with MAX_VALUE prices
fix(shortestpath): TransportNode cost double-count + overflow; remove MoA audit temp plugin
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 9, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: cec8b537-485c-4289-bcda-1fcb8c47c7d8

📥 Commits

Reviewing files that changed from the base of the PR and between 6d0ccd0 and 4ee96d9.

⛔ Files ignored due to path filters (1)
  • runelite-client/src/main/resources/net/runelite/client/plugins/microbot/shortestpath/teleportation_spells.tsv is excluded by !**/*.tsv
📒 Files selected for processing (29)
  • docs/F2P_WEBWALKER_HARNESS.md
  • docs/entity-guides/README.md
  • docs/entity-guides/movement.md
  • gradle.properties
  • microbot-cli
  • runelite-client/build.gradle.kts
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/BlockingEventManager.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/MicrobotPlugin.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/agentserver/AgentServerPlugin.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/agentserver/handler/QuestHelperHandler.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/agentserver/handler/WalkHandler.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/moaaudit/MoaAuditPlugin.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/QuestHelperPlugin.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/QuestScript.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/romeoandjuliet/RomeoAndJuliet.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/logic/RomeoAndJuliet.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/shortestpath/ShortestPathScript.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/shortestpath/pathfinder/CollisionMap.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/shortestpath/pathfinder/PathfinderConfig.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/shortestpath/pathfinder/TransportNode.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/testing/webwalker/F2PWebWalkerHarnessPlugin.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/testing/webwalker/F2PWebWalkerRoute.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/keyboard/Rs2Keyboard.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/magic/Rs2Spells.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/Rs2Walker.java
  • runelite-client/src/test/java/net/runelite/client/plugins/microbot/shortestpath/ShortestPathCoreTest.java
  • runelite-client/src/test/java/net/runelite/client/plugins/microbot/util/walker/Rs2WalkerUnitTest.java
  • runelite-client/src/test/resources/threadsafety/client-thread-guardrail-baseline.txt
  • scripts/run-f2p-webwalker-harness.sh

Walkthrough

This PR introduces an F2P webwalker regression testing harness alongside substantial improvements to walker robustness and pathfinding. The core addition is a complete testing infrastructure (F2PWebWalkerHarnessPlugin, 16 pre-configured routes, runner script, and documentation) for validating webwalker behavior on fresh F2P accounts. To support this, Rs2Walker gains cancellation-aware path management, improved minimap click targeting with interpolation and fallback strategies, better door/transport interaction suppression to avoid repeated failures, and path reuse optimization. The agent server gains distance-based walk arrival detection via an optional parameter, and a new quest-helper HTTP API for remote quest control. Supporting changes include version bump to 2.5.7, improvements to quest-item price selection and Romeo & Juliet quest routing, and simplification of keyboard event dispatch.

Possibly related PRs

  • chsami/Microbot#1764: Both modify the same QuestScript item-selection logic—choosing lowest-priced tradable variants and stricter GE price validation.
  • chsami/Microbot#1751: Both modify TransportNode cost calculation, CollisionMap MoA logging, and pathfinder region-locking for Map of Alacrity.
  • chsami/Microbot#1750: Both refactor seasonal-transport (MoA) handling, including Rs2Walker updates, pathfinder logic, and debug output improvements.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.42.1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/Rs2Walker.java

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 and usage tips.

@chsami chsami merged commit 30c1a22 into main May 9, 2026
0 of 3 checks passed
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.

4 participants