Skip to content

Comments

fix(Rs2Spellbook): Arceuus to Modern spellbook swap fixes#1436

Merged
gmason0 merged 1 commit intochsami:developmentfrom
Gage307:development
Aug 29, 2025
Merged

fix(Rs2Spellbook): Arceuus to Modern spellbook swap fixes#1436
gmason0 merged 1 commit intochsami:developmentfrom
Gage307:development

Conversation

@Gage307
Copy link
Contributor

@Gage307 Gage307 commented Aug 27, 2025

  • corrected the world point for Tyss
  • fixed switchTo failing to swap from Arceuus to Modern

Summary by CodeRabbit

  • Bug Fixes
    • Corrected the Arceuus spellbook altar location to match the current in-game position, improving navigation and interaction reliability.
    • Improved switching from Arceuus to Modern spellbook by using a more reliable method in this scenario, reducing failures and unnecessary pathing during transitions.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 27, 2025

Walkthrough

Updated ARCEUUS spellbook location coordinates. Modified switchTo control flow: when switching from ARCEUUS to MODERN, the method now uses switchViaNpc() with an early return instead of switchViaAltar().

Changes

Cohort / File(s) Summary
Spellbook enum and switching logic
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/magic/Rs2Spellbook.java
- ARCEUUS switchLocation WorldPoint updated from (1694, 3878, 0) to (1712, 3883, 0)
- In switchTo(): ARCEUUS→MODERN path now calls switchViaNpc() and returns early instead of using switchViaAltar()

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Caller
  participant Rs2Spellbook
  participant CurrentSpellbook
  participant switchViaNpc
  participant switchViaAltar

  Caller->>Rs2Spellbook: switchTo(MODERN)
  Rs2Spellbook->>CurrentSpellbook: getCurrent()
  alt Current is ARCEUUS (changed path)
    Note over Rs2Spellbook: New flow for ARCEUUS→MODERN
    Rs2Spellbook->>switchViaNpc: invoke()
    switchViaNpc-->>Rs2Spellbook: result
    Rs2Spellbook-->>Caller: return
  else Current is not ARCEUUS
    Note over Rs2Spellbook: Existing logic continues
    Rs2Spellbook->>switchViaAltar: possibly invoke()
    switchViaAltar-->>Rs2Spellbook: result
    Rs2Spellbook-->>Caller: return
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/magic/Rs2Spellbook.java (2)

78-81: Tyss location update: looks plausible; please verify the exact tile and ID.

  • Confirm 1712,3883,0 is Tyss’ current tile (not just “Dark Altar” in general). If this is Tyss’ exact tile, adjust the comment to reflect “Tyss (Dark Altar)” for clarity.
  • The comment says “Tyss NPC ID” but the value is NpcID.ARCEUUS_DARKGUARDIAN. If RuneLite exposes NpcID.TYSS, prefer that for correctness.

Proposed tweaks:

-            new WorldPoint(1712, 3883, 0), // Dark Altar location north of Arceuus
-            NpcID.ARCEUUS_DARKGUARDIAN, // Tyss NPC ID
+            new WorldPoint(1712, 3883, 0), // Tyss (Dark Altar), north of Arceuus
+            NpcID.TYSS, // Tyss NPC ID

206-210: Arceuus→Modern path: wait for the varbit and keep a safe fallback; use enum ‘==’.

  • Using Tyss here is correct, but return as “successful” only after the spellbook varbit flips to MODERN.
  • If Tyss isn’t reachable, fall back to altar logic.
  • Prefer == for enum comparison.

Apply:

-                // For switching to MODERN, try altar method first (most reliable)
-                // We determine which altar to use based on current spellbook
-                if(Rs2Magic.getSpellbook().equals(Rs2Spellbook.ARCEUUS)) return switchViaNpc(); //Needed for swapping from Arceuus to Modern.
-                return switchViaAltar();
+                // Prefer Tyss when coming from ARCEUUS; otherwise fall back to altar.
+                if (Rs2Magic.getSpellbook() == Rs2Spellbook.ARCEUUS) {
+                    boolean started = switchViaNpc(); // Needed for swapping from Arceuus to Modern.
+                    if (started) {
+                        return sleepUntil(() -> getCurrentSpellbook() == MODERN, 5000);
+                    }
+                    // Fallback if Tyss not reachable
+                }
+                return switchViaAltar();

To align semantics across methods, also make switchViaNpc() wait for the varbit flip:

@@
-                            Rs2Dialogue.clickOption("I'd like to stop using your spellbook now.");
-                            return Rs2Dialogue.sleepUntilHasContinue();
+                            Rs2Dialogue.clickOption("I'd like to stop using your spellbook now.");
+                            return sleepUntil(() -> getCurrentSpellbook() == MODERN, 5000);
@@
-                            Rs2Dialogue.clickOption("Can I try the magicks myself?");
-                            return Rs2Dialogue.sleepUntilHasContinue();
+                            Rs2Dialogue.clickOption("Can I try the magicks myself?");
+                            return sleepUntil(() -> getCurrentSpellbook() == ARCEUUS, 5000);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c66a748 and 563989f.

📒 Files selected for processing (1)
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/magic/Rs2Spellbook.java (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/magic/Rs2Spellbook.java (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/magic/Rs2Magic.java (1)
  • Rs2Magic (43-600)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build

@gmason0 gmason0 merged commit d8007f0 into chsami:development Aug 29, 2025
2 checks passed
@chsami chsami mentioned this pull request Sep 3, 2025
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.

2 participants