Skip to content

Comments

feat(sandminer): drop empty waterskins when humidify disabled#1440

Merged
gmason0 merged 2 commits intochsami:mainfrom
runsonmypc:sandstone-miner-drop-empty-waterskins
Aug 29, 2025
Merged

feat(sandminer): drop empty waterskins when humidify disabled#1440
gmason0 merged 2 commits intochsami:mainfrom
runsonmypc:sandstone-miner-drop-empty-waterskins

Conversation

@runsonmypc
Copy link
Contributor

@runsonmypc runsonmypc commented Aug 29, 2025

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

  • Added dropEmptyWaterskins() method to check and drop empty waterskins
  • Integrated dropping logic into the mining loop when humidify is disabled

Summary by CodeRabbit

  • New Features
    • Sand Miner now automatically drops empty waterskins while mining when Humidify is disabled, freeing inventory space and reducing manual cleanup.
    • Humidify-enabled behavior is unchanged, preserving existing hydration workflows.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 29, 2025

Walkthrough

Added an early-loop inventory cleanup in the sand mining script: when config.useHumidify() is false and the player is idle (!Rs2Player.isAnimating()), the script drops WATER_SKIN0 via a new private helper. No public APIs changed.

Changes

Cohort / File(s) Summary of Changes
Sand Miner Script
runelite-client/src/main/java/net/runelite/client/plugins/microbot/gabplugs/sandminer/GabulhasSandMinerScript.java
In the main mining loop, added an early-in-loop conditional: if (!config.useHumidify() && !Rs2Player.isAnimating()) { dropEmptyWaterskins(); }. Added private dropEmptyWaterskins() which repeatedly calls Rs2Inventory.drop(ItemID.WATER_SKIN0) while Rs2Inventory.hasItem(ItemID.WATER_SKIN0). Humidify behavior unchanged. No public signature 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
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.


📜 Recent 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 1cf929a and ba18db4.

📒 Files selected for processing (1)
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/gabplugs/sandminer/GabulhasSandMinerScript.java (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/gabplugs/sandminer/GabulhasSandMinerScript.java
⏰ 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
✨ 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 @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit 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:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit 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 @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @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/gabplugs/sandminer/GabulhasSandMinerScript.java (2)

86-90: Avoid dropping while actively animating; gate on idle to reduce interaction churn

Dropping 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 loop

Current 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 13af940 and 1cf929a.

📒 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

@gmason0 gmason0 merged commit 8da3f86 into chsami:main Aug 29, 2025
2 checks passed
gmason0 added a commit that referenced this pull request Aug 29, 2025
gmason0 pushed a commit that referenced this pull request Aug 29, 2025
* 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)
@coderabbitai coderabbitai bot mentioned this pull request Aug 29, 2025
@runsonmypc runsonmypc deleted the sandstone-miner-drop-empty-waterskins branch August 30, 2025 17:36
gmason0 added a commit that referenced this pull request Aug 31, 2025
* 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>
@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