feat(sandminer): drop empty waterskins when humidify disabled#1440
feat(sandminer): drop empty waterskins when humidify disabled#1440gmason0 merged 2 commits intochsami:mainfrom
Conversation
WalkthroughAdded an early-loop inventory cleanup in the sand mining script: when Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Script as SandMinerScript
participant Config as Config
participant Player as Player
participant Inv as Inventory
loop While !Inv.isFull() && Script.isRunning()
Script->>Config: useHumidify()
alt Humidify disabled
Script->>Player: isAnimating()?
alt Player idle
Script->>Inv: hasItem(WATER_SKIN0)?
opt If present
Script->>Inv: drop(WATER_SKIN0) [repeat until none]
end
else Player animating
Note over Script,Player: Skip drops while animating
end
else Humidify enabled
Note over Script,Inv: Skip empty waterskin drop
end
Note over Script: Continue mining actions (unchanged)
end
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. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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)
✨ 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: 0
🧹 Nitpick comments (2)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/gabplugs/sandminer/GabulhasSandMinerScript.java (2)
86-90: Avoid dropping while actively animating; gate on idle to reduce interaction churnDropping while the player is mid-mining can add unnecessary menu interactions each tick. Gate the drop behind an idle check so it only fires when not animating.
- // Drop empty waterskins if not using humidify - if (!config.useHumidify()) { - dropEmptyWaterskins(); - } + // Drop empty waterskins if not using humidify (only when idle) + if (!config.useHumidify() && !Rs2Player.isAnimating()) { + dropEmptyWaterskins(); + }
139-143: Drop all empty waterskins at once instead of one per loopCurrent logic drops a single Waterskin(0) per loop iteration, which can leave clutter around for longer than necessary (e.g., when returning from bank with multiple empties). Drop until none remain.
- private void dropEmptyWaterskins() { - if (Rs2Inventory.hasItem(ItemID.WATER_SKIN0)) { - Rs2Inventory.drop(ItemID.WATER_SKIN0); - } - } + private void dropEmptyWaterskins() { + while (Rs2Inventory.hasItem(ItemID.WATER_SKIN0)) { + Rs2Inventory.drop(ItemID.WATER_SKIN0); + } + }Optional: call
Rs2Antiban.actionCooldown()after the loop to humanize timing if you notice rapid-fire drops.
📜 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/gabplugs/sandminer/GabulhasSandMinerScript.java(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/gabplugs/sandminer/GabulhasSandMinerScript.java (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/inventory/Rs2Inventory.java (1)
Rs2Inventory(60-2244)
⏰ 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
* feat(sandminer): drop empty waterskins when humidify is disabled * refactor(sandminer): drop empty waterskins only when idle and drop all --------- Co-authored-by: Pert <your.email@example.com> (cherry picked from commit 8da3f86)
* feat(sandminer): drop empty waterskins when humidify disabled (#1440) * feat(sandminer): drop empty waterskins when humidify is disabled * refactor(sandminer): drop empty waterskins only when idle and drop all --------- Co-authored-by: Pert <your.email@example.com> * Revert "feat(sandminer): drop empty waterskins when humidify disabled (#1440)" This reverts commit 8da3f86. * AutoLoginConfig.java config changes for world selection config changes * script updated to select world hop configs script updated to select world hop configs * Update runelite-client/src/main/java/net/runelite/client/plugins/microbot/accountselector/AutoLoginScript.java Co-authored-by: Igor <74077743+Bolado@users.noreply.github.com> * Update runelite-client/src/main/java/net/runelite/client/plugins/microbot/accountselector/AutoLoginScript.java Co-authored-by: Igor <74077743+Bolado@users.noreply.github.com> * Update runelite-client/src/main/java/net/runelite/client/plugins/microbot/accountselector/AutoLoginScript.java Co-authored-by: Igor <74077743+Bolado@users.noreply.github.com> * Update runelite-client/src/main/java/net/runelite/client/plugins/microbot/accountselector/AutoLoginScript.java Co-authored-by: Igor <74077743+Bolado@users.noreply.github.com> * Missing imports added by bolado import org.slf4j.event.Level; Co-authored-by: Igor <74077743+Bolado@users.noreply.github.com> --------- Co-authored-by: George M <19415334+g-mason0@users.noreply.github.com> Co-authored-by: chsami <sami.chkhachkhi@gmail.com> Co-authored-by: runsonmypc <45095641+runsonmypc@users.noreply.github.com> Co-authored-by: Pert <your.email@example.com> Co-authored-by: Igor <74077743+Bolado@users.noreply.github.com>
Description
Added automatic dropping of empty waterskins (Waterskin(0)) to the Sandstone Miner plugin when the "Use Humidify" option is disabled. This prevents inventory clutter from depleted waterskins during mining sessions without the humidify spell.
Changes
dropEmptyWaterskins()method to check and drop empty waterskinsSummary by CodeRabbit