Conversation
WalkthroughAdds a volatile flag to coordinate Ferox pool usage, expands run-energy/HP checks to trigger drinking, reorders bank teleport priorities based on refill need, introduces Mythic Statue teleport during Wrath walking and reduces a sleep, and adjusts crafting flow to re-enable break lock and transition to BANKING. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller as Caller
participant Rc as RcScript
participant Move as Movement
participant Pool as Ferox Pool
Caller->>Rc: handleFeroxRunEnergy()
alt forceDrinkAtFerox || runEnergy <= 15 || hp% <= 20
Rc->>Move: Navigate to Ferox (if far)
Move-->>Rc: Within pool range
Rc->>Pool: Drink
Rc-->>Rc: Wait until runEnergy > 90
Rc-->>Rc: forceDrinkAtFerox = false
else
Rc-->>Caller: No action
end
sequenceDiagram
autonumber
participant Bank as Banking Logic
participant Rc as RcScript
participant TP as Teleports
participant Ferox as Ferox Flow
Bank->>Rc: Determine teleport order
Rc-->>Rc: needRefill = forceDrinkAtFerox || runEnergy <= 15 || hp% <= 20
alt needRefill
Rc->>TP: Try Ferox Enclave first (then Crafting, Farming)
TP-->>Rc: Using Ferox Enclave
Rc-->>Rc: forceDrinkAtFerox = true
Rc->>Ferox: handleFeroxRunEnergy()
else
Rc->>TP: Original order (Crafting, Farming, Ferox)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/frosty/frostyrc/RcScript.java (1)
335-351: Prevent unintended world-walking to Ferox; gate by proximity/region and add timeouts/reset.Calling handleFeroxRunEnergy from arbitrary states can trigger a long walk across the world to feroxPoolWp. This risks getting stuck or fighting with teleport logic. Also, sleepUntil has no explicit timeout here, and forceDrinkAtFerox may be left true for longer than intended if movement/drink fails.
Recommend:
- Only walk to the pool if already near (or already in the Ferox region). Otherwise, set the flag and return, letting handleBankTeleport prioritize Ferox and consume the flag.
- Add explicit timeouts to sleepUntil to avoid indefinite waits.
- Ensure the flag resets even when the pool interaction doesn’t complete quickly.
Proposed patch within this block:
- if (forceDrinkAtFerox || Rs2Player.getRunEnergy() <= 15 || Rs2Player.getHealthPercentage() <= 20) { - Microbot.log("We are thirsty...let us Drink"); - forceDrinkAtFerox = true; - if (plugin.getMyWorldPoint().distanceTo(feroxPoolWp) > 5) { - Microbot.log("Walking to Ferox pool"); - Rs2Walker.walkTo(feroxPoolWp); - sleepUntil(() -> plugin.getMyWorldPoint().distanceTo(feroxPoolWp) < 5); - } - - if (plugin.getMyWorldPoint().distanceTo(feroxPoolWp) < 5) { - Microbot.log("Interacting with the Ferox pool"); - Rs2GameObject.interact(feroxPool, "Drink"); - } - sleepUntil(() -> (!Rs2Player.isInteracting()) && !Rs2Player.isAnimating() && Rs2Player.getRunEnergy() > 90); - sleepGaussian(1100, 200); - forceDrinkAtFerox = false; - } + if (forceDrinkAtFerox || Rs2Player.getRunEnergy() <= 15 || Rs2Player.getHealthPercentage() <= 20) { + Microbot.log("We are thirsty...let us Drink"); + int dist = plugin.getMyWorldPoint().distanceTo(feroxPoolWp); + // If we're far and not already in Ferox region, just set the flag and let bank teleport handle routing. + if (dist > 25 && !Teleports.FEROX_ENCLAVE.matchesRegion(plugin.getMyWorldPoint().getRegionID())) { + forceDrinkAtFerox = true; + return; + } + forceDrinkAtFerox = true; + if (dist > 5) { + Microbot.log("Walking to Ferox pool"); + Rs2Walker.walkTo(feroxPoolWp); + sleepUntil(() -> plugin.getMyWorldPoint().distanceTo(feroxPoolWp) < 5, 10000); + } + if (plugin.getMyWorldPoint().distanceTo(feroxPoolWp) < 5) { + Microbot.log("Interacting with the Ferox pool"); + Rs2GameObject.interact(feroxPool, "Drink"); + } + sleepUntil(() -> (!Rs2Player.isInteracting()) && !Rs2Player.isAnimating() && Rs2Player.getRunEnergy() > 90, 15000); + sleepGaussian(1100, 200); + forceDrinkAtFerox = false; + }
🧹 Nitpick comments (2)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/frosty/frostyrc/RcScript.java (2)
463-468: Add a post-click wait after Mythic Statue interaction to avoid walking during teleport anim.After clicking the statue, immediately walking can conflict with the teleport animation. Add a short wait for the animation to finish.
- GameObject statue = Rs2GameObject.get("Mythic Statue"); - if (statue != null && !Rs2Player.isAnimating()) { - Rs2GameObject.interact(statue, "Teleport"); - } + GameObject statue = Rs2GameObject.get("Mythic Statue"); + if (statue != null && !Rs2Player.isAnimating()) { + Rs2GameObject.interact(statue, "Teleport"); + sleepUntil(() -> !Rs2Player.isAnimating(), 5000); + }If you’ve seen occasional stalls here, this should reduce them. If not, feel free to skip.
750-756: Reordered bank teleports based on refill need is good; consider aligning thresholds.The new needRefill gate uses energy <= 15 or HP <= 20%, while other pool triggers in this class (e.g., PoH pool usage) use 45%. Consider harmonizing thresholds or making them config-driven to avoid inconsistent behavior between PoH vs Ferox refills.
📜 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.
📒 Files selected for processing (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/frosty/frostyrc/RcScript.java(7 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/frosty/frostyrc/RcScript.java (2)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/player/Rs2Player.java (1)
Rs2Player(67-2062)runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/gameobject/Rs2GameObject.java (1)
Rs2GameObject(36-2002)
🔇 Additional comments (2)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/frosty/frostyrc/RcScript.java (2)
51-51: Sensible cross-method coordination with a volatile flag.Using a volatile boolean for forceDrinkAtFerox is a reasonable choice for visibility across the scheduler and any auxiliary threads. No concerns here.
770-773: Immediate Ferox drink after teleport is the right call.Setting the flag and invoking handleFeroxRunEnergy right after a Ferox teleport eliminates the “teleport-to-Ferox-but-didn’t-drink” bounce. Nice.
| handleFeroxRunEnergy(); | ||
|
|
||
| if (plugin.isBreakHandlerEnabled()) { | ||
| BreakHandlerScript.setLockState(false); | ||
| } | ||
|
|
There was a problem hiding this comment.
🛠️ Refactor suggestion
Don’t call handleFeroxRunEnergy from CRAFTING; set the flag and let teleport logic consume it.
Calling handleFeroxRunEnergy here can trigger a long “walk to Ferox” from within altar regions. Safer: mark intent via forceDrinkAtFerox and allow handleBankTeleport (now prioritizing Ferox when needRefill) to route correctly. If we happen to already be at/near Ferox, still allow immediate drink.
- handleFeroxRunEnergy();
+ if (Teleports.FEROX_ENCLAVE.matchesRegion(plugin.getMyWorldPoint().getRegionID())
+ || plugin.getMyWorldPoint().distanceTo(feroxPoolWp) < 25) {
+ handleFeroxRunEnergy();
+ } else {
+ // Defer to bank teleport routing; this prevents long world-walks from altars.
+ forceDrinkAtFerox = true;
+ }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| handleFeroxRunEnergy(); | |
| if (plugin.isBreakHandlerEnabled()) { | |
| BreakHandlerScript.setLockState(false); | |
| } | |
| // Only immediately handle Ferox run energy if we're in or very near Ferox; | |
| // otherwise defer to teleport routing via forceDrinkAtFerox. | |
| if (Teleports.FEROX_ENCLAVE.matchesRegion(plugin.getMyWorldPoint().getRegionID()) | |
| || plugin.getMyWorldPoint().distanceTo(feroxPoolWp) < 25) | |
| { | |
| handleFeroxRunEnergy(); | |
| } | |
| else | |
| { | |
| // Defer to bank teleport routing; prevents long world-walks from altars. | |
| forceDrinkAtFerox = true; | |
| } | |
| if (plugin.isBreakHandlerEnabled()) | |
| { | |
| BreakHandlerScript.setLockState(false); | |
| } |
🤖 Prompt for AI Agents
In
runelite-client/src/main/java/net/runelite/client/plugins/microbot/frosty/frostyrc/RcScript.java
around lines 720 to 725, remove the direct call to handleFeroxRunEnergy and
instead set the forceDrinkAtFerox flag so teleport/banking logic can consume the
intent; ensure handleBankTeleport (which now prioritizes Ferox when needRefill)
will route to Ferox and call handleFeroxRunEnergy when it performs the teleport,
and add a short conditional to still call handleFeroxRunEnergy immediately only
if the player is already at or very near Ferox to avoid long unwanted walks from
altar regions.
Fixed not drinking at ferox if energy/health recovered before drinking.
Fixed getting stuck after teleporting to bank by checking energy/health after crafting.
Fixed getting stuck after break by allowing breaks after runcrafting.
Fixed logic that bounced back to bank after already teleporting to Ferox.
Faster walking to wrath ruins.
Summary by CodeRabbit