Skip to content

2.6.1#1780

Merged
chsami merged 18 commits into
mainfrom
development
May 18, 2026
Merged

2.6.1#1780
chsami merged 18 commits into
mainfrom
development

Conversation

@chsami
Copy link
Copy Markdown
Owner

@chsami chsami commented May 18, 2026

No description provided.

runsonmypc and others added 18 commits April 27, 2026 14:49
…irst available action

Three related improvements to the quest helper auto-runner so it stops
clicking through closed doors, picking the wrong menu option, and
crashing other plugins via null MenuOptionClicked events.

Reachability:
- applyNpcStep direct-click now also requires npc.hasLineOfSight().
  Rs2Walker.canReach() pathfinds through closed doors (the walker
  opens them en route), so canReach==true alone doesn't guarantee a
  direct interaction will succeed.
- applyObjectStep walk gate now also fires when LoS to the target is
  blocked, so the walker can route the player past the blocking
  geometry instead of us bouncing on "I can't reach that!".

Menu option selection:
- chooseCorrect{Object,NPC,Item}Option fall back to the entity's
  first non-empty action when no step-text keyword matches, instead
  of returning "" / "use" / "Talk-to" blindly.

Null safety on MenuOptionClicked subscribers:
- Rs2Gembag, PouchScript, QuestBankTabInterface and IncantationStep
  now early-return on null event.getMenuOption(); these previously
  threw NPEs whenever a programmatic menu invoke fired with a null
  option, spamming the chat box with stack traces.
- Removed a stray System.out.println in PouchScript.
…ker-fallback

fix(questhelper): require LoS before direct interaction; default to first available action
Player.isInteracting() stays true for many seconds after benign actions
(closing a shop, talking to an NPC, getting aggro'd) because the engine
keeps the interaction pointer set until the player moves or combat
resets. OSRS does not block hops in that state, but this guard did,
causing plugins to spin on "Local player is interacting, cannot hop
worlds" forever after Rs2Shop.closeShop() and similar flows.

Replace the isInteracting() check with the conditions that actually
block a hop: active combat (Rs2Combat.inCombat) and blocking widgets
(Rs2Bank/Rs2Shop/Rs2Dialogue). Wilderness PvP timer remains
server-enforced via client.hopToWorld().

Closes #1772
Need programmatic quest selection from the ironman-guide skill; Quest Helper's
plugin panel was the only way to start a quest. Adds a handler that wraps
QuestHelperPlugin.getQuestManager().startUpQuest so the skill can pick a quest
over HTTP, plus fixes the crashes and wrong-click behavior that surfaced while
driving QH auto-play during the BRUHsailer run.

agent-server:
- QuestHelperHandler: /questhelper/start, /stop, /active, /list. Resolves quest
  by enum name or display name via QuestHelperQuest.valueOf / getByName.

QuestScript (reachability + action selection):
- Require line-of-sight in addition to canReach() before clicking an NPC or
  object — canReach pathfinds through closed doors, so a true return doesn't
  mean a direct click will land.
- When LOS fails, walk to the target (lets the walker open the door en route)
  instead of firing a click that will miss.
- Fallback to the object/NPC/inventory item's first non-empty action when no
  step text matches an action name, so QH doesn't emit an empty menu op.

Null-guards on MenuOptionClicked.getMenuOption() in:
- PouchScript, Rs2Gembag, QuestBankTabInterface, IncantationStep
  (all previously NPE'd on synthetic/agent-driven menu events where menuOption
  is null)
POST /logout calls Rs2Player.logout() on the script thread and polls
client.getGameState() == LOGIN_SCREEN; GET returns current login state.
Symmetric to LoginHandler. Used by ironguide to gate Microbot ↔ DreamBot
handoffs (logout via Microbot before launching DreamBot, log back in after).
Iterates QuestHelperQuest.values() on the client thread and returns
{enum, displayName, state} per quest where state ∈ {NOT_STARTED,
IN_PROGRESS, FINISHED} via QuestHelperQuest.getState(Client). Lets
external tooling bulk-audit per-quest completion without the side
effects of /quest-helper/start+stop (which set TurnOn=true).
Body values are parsed by Gson into native JSON types, so a client sending
{"timeout": "30"}, {"timeout": true}, or {"timeout": null} would crash the
handler on the (Number) cast. Accept Number or numeric String, fall back to
the default for anything else.
Global.sleep / sleepUntil early-return when invoked on the client
thread, so the post-hop wait inside the runOnClientThreadOptional
lambda was a no-op: the success check fired microseconds after
issuing the request, before the server had processed it. The function
returned false on every call, callers retried via sleepUntil polling,
and Microbot.java logged "Failed to hop to world N" 3-4 times per
actually-successful hop.

Move the wait off the client thread. The lambda now only validates
and issues the hop request. The script thread then sleeps and
sleepUntils for HOPPING / world-change / confirm widget, handles the
confirm-dialog fallback, and waits for the hop to fully land
(GameState.LOGGED_IN on the target world) before returning. Success
is reported as getWorld() == worldNumber, the definitive signal, so
callers can trust the return value.

Also: the "already on target world" guard now returns true (idempotent
success) instead of false, killing the retry loop that triggered the
spam on the second and subsequent calls.

Closes #1550
…r-logout

feat(agent-server): add quest-helper and /logout endpoints
fix: hopToWorld guard rejects valid hops after interactions
Catalog-backed path edges and transport objects now bypass door probes and blacklist paths so handleTransports owns them. Adjacent-origin short hops and segment-end distance checks align lookahead with the multimap.

Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid null localpoint stalls by falling back to minimap-toward clicks.
Drop noisy minimap log spam and add transport fallback chain.
- TSV rows can span planes; plane equality hid catalog match
- Refresh client-thread guardrail baseline
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

This PR bumps Microbot from 2.6.0 to 2.6.1 and consolidates project documentation into a user/developer/runtime routing structure. The Agent Server gains /logout and expanded /quest-helper endpoints. Rs2Walker is refactored to distinguish catalog-backed transport segments from door interactions, with corresponding updates to door-candidate and blocker-scanning logic. Microbot.hopToWorld is hardened with activity guards and improved post-hop validation. QuestScript interactions now require line-of-sight before direct engagement, and multiple event handlers are guarded against null menu options.

Possibly related PRs

  • chsami/Microbot#1774: Both PRs register and implement LogoutHandler and extend QuestHelperHandler with new agent-server endpoints.
  • chsami/Microbot#1755: Both PRs apply the same questhelper interaction line-of-sight checks and action fallbacks, plus identical null-guards for event.getMenuOption() across multiple handler classes.
  • chsami/Microbot#1775: Both PRs modify Rs2Walker.walkFastCanvas fallback logic and Rs2MiniMap.worldToMinimap null behavior, with overlapping transport/obstacle resolution code paths.
🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (1 warning, 2 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 24.44% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title '2.6.1' is a version number and does not clearly summarize the primary changes in the pull request. Use a descriptive title that summarizes the main changes, such as 'Version 2.6.1: Improve logout endpoint, world hopping, and documentation'
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess whether it relates to the changeset. Add a pull request description that summarizes the key changes and improvements included in this release version
✅ Passed checks (2 passed)
Check name Status Explanation
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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.2)
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 747a6a4 into main May 18, 2026
2 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