Agility Pyramid plugin will now auto-cast Humidify#1467
Agility Pyramid plugin will now auto-cast Humidify#1467chsami merged 1 commit intochsami:developmentfrom
Conversation
heap-overfl0w
commented
Sep 3, 2025
- Agility Pyramid plugin will now auto-cast Humidify if you have the requirements satisfied to do so.
- Fixed a deprecated API call with Simon Templeton by using Rs2NpcModel instead.
…quirements satisfied to do so. Fixed a deprecated API call with Simon Templeton by using Rs2NpcModel instead.
Walkthrough
Possibly related PRs
✨ Finishing Touches
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. 🪧 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
📜 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/agility/courses/PyramidCourse.java(3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-25T15:51:39.272Z
Learnt from: runsonmypc
PR: chsami/Microbot#1417
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/agility/AgilityScript.java:13-13
Timestamp: 2025-08-25T15:51:39.272Z
Learning: Both net.runelite.api.ItemID and net.runelite.api.gameval.ItemID are valid import paths in the RuneLite codebase. The microbot plugins consistently use net.runelite.api.ItemID as their established pattern.
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/agility/courses/PyramidCourse.java
🧬 Code graph analysis (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/agility/courses/PyramidCourse.java (4)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/magic/Rs2Magic.java (1)
Rs2Magic(44-608)runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/inventory/Rs2Inventory.java (1)
Rs2Inventory(60-2244)runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/Global.java (1)
Global(10-171)runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/player/Rs2Player.java (1)
Rs2Player(67-2070)
🔇 Additional comments (2)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/agility/courses/PyramidCourse.java (2)
19-21: Imports for Rs2NpcModel/Magic usage look correct.Dependencies align with Rs2Inventory.useItemOnNpc(int, Rs2NpcModel) and MagicAction.HUMIDIFY.
1163-1167: Good deprecation migration to Rs2NpcModel.Replaces the deprecated overload cleanly and preserves reachability/dialogue handling.
| final boolean hasEmpty = Rs2Inventory.contains(ItemID.WATERSKIN0); | ||
| if (!hasEmpty) return false; | ||
|
|
||
| final boolean hasFilled = Rs2Inventory.contains( | ||
| ItemID.WATERSKIN1, ItemID.WATERSKIN2, ItemID.WATERSKIN3, ItemID.WATERSKIN4 | ||
| ); | ||
|
|
||
| if (!hasFilled && Rs2Magic.canCast(MagicAction.HUMIDIFY)) { | ||
| log.debug("All waterskins are empty; casting Humidify"); | ||
| if (Rs2Magic.cast(MagicAction.HUMIDIFY)) { | ||
| Global.sleepUntil(Rs2Player::isAnimating, 1500); | ||
| Global.sleepUntil(() -> !Rs2Player.isAnimating() && !Rs2Inventory.contains(ItemID.WATERSKIN0), 3500); | ||
| Global.sleep(200, 400); | ||
| } | ||
| return true; | ||
| } | ||
| return false; | ||
|
|
||
| if (hasFilled && Rs2Magic.canCast(MagicAction.HUMIDIFY)) { | ||
| log.debug("Have filled waterskin(s); not casting Humidify because not all Waterskins are empty"); | ||
| return false; | ||
| } | ||
|
|
||
| log.debug("Cannot cast Humidify; dropping empty waterskin(s)"); | ||
| Rs2Inventory.drop(ItemID.WATERSKIN0); | ||
| Global.sleep(300, 500); | ||
| return true; |
There was a problem hiding this comment.
Full inventory + mixed waterskins can block pyramid-top pickup — free a slot.
When some waterskins are filled and others empty, this method returns false (no cast, no drop). If the inventory is full, the bot may fail to loot the pyramid top. Drop one empty waterskin when inventory is full regardless of Humidify availability to avoid stalling.
Apply this minimal guard right after computing hasFilled:
final boolean hasFilled = Rs2Inventory.contains(
ItemID.WATERSKIN1, ItemID.WATERSKIN2, ItemID.WATERSKIN3, ItemID.WATERSKIN4
);
+// If inventory is full and we have a mix of filled and empty waterskins, free one slot.
+if (hasFilled && Rs2Inventory.isFull()) {
+ log.debug("Inventory full with mixed waterskins; dropping one empty waterskin to free a slot");
+ Rs2Inventory.drop(ItemID.WATERSKIN0);
+ Global.sleep(300, 500);
+ return true;
+}
+
if (!hasFilled && Rs2Magic.canCast(MagicAction.HUMIDIFY)) {
log.debug("All waterskins are empty; casting Humidify");
if (Rs2Magic.cast(MagicAction.HUMIDIFY)) {📝 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.
| final boolean hasEmpty = Rs2Inventory.contains(ItemID.WATERSKIN0); | |
| if (!hasEmpty) return false; | |
| final boolean hasFilled = Rs2Inventory.contains( | |
| ItemID.WATERSKIN1, ItemID.WATERSKIN2, ItemID.WATERSKIN3, ItemID.WATERSKIN4 | |
| ); | |
| if (!hasFilled && Rs2Magic.canCast(MagicAction.HUMIDIFY)) { | |
| log.debug("All waterskins are empty; casting Humidify"); | |
| if (Rs2Magic.cast(MagicAction.HUMIDIFY)) { | |
| Global.sleepUntil(Rs2Player::isAnimating, 1500); | |
| Global.sleepUntil(() -> !Rs2Player.isAnimating() && !Rs2Inventory.contains(ItemID.WATERSKIN0), 3500); | |
| Global.sleep(200, 400); | |
| } | |
| return true; | |
| } | |
| return false; | |
| if (hasFilled && Rs2Magic.canCast(MagicAction.HUMIDIFY)) { | |
| log.debug("Have filled waterskin(s); not casting Humidify because not all Waterskins are empty"); | |
| return false; | |
| } | |
| log.debug("Cannot cast Humidify; dropping empty waterskin(s)"); | |
| Rs2Inventory.drop(ItemID.WATERSKIN0); | |
| Global.sleep(300, 500); | |
| return true; | |
| final boolean hasEmpty = Rs2Inventory.contains(ItemID.WATERSKIN0); | |
| if (!hasEmpty) return false; | |
| final boolean hasFilled = Rs2Inventory.contains( | |
| ItemID.WATERSKIN1, ItemID.WATERSKIN2, ItemID.WATERSKIN3, ItemID.WATERSKIN4 | |
| ); | |
| // If inventory is full with a mix of empty + filled waterskins, free one slot to avoid stalling. | |
| if (hasFilled && Rs2Inventory.isFull()) { | |
| log.debug("Inventory full with mixed waterskins; dropping one empty waterskin to free a slot"); | |
| Rs2Inventory.drop(ItemID.WATERSKIN0); | |
| Global.sleep(300, 500); | |
| return true; | |
| } | |
| if (!hasFilled && Rs2Magic.canCast(MagicAction.HUMIDIFY)) { | |
| log.debug("All waterskins are empty; casting Humidify"); | |
| if (Rs2Magic.cast(MagicAction.HUMIDIFY)) { | |
| Global.sleepUntil(Rs2Player::isAnimating, 1500); | |
| Global.sleepUntil(() -> !Rs2Player.isAnimating() && !Rs2Inventory.contains(ItemID.WATERSKIN0), 3500); | |
| Global.sleep(200, 400); | |
| } | |
| return true; | |
| } | |
| if (hasFilled && Rs2Magic.canCast(MagicAction.HUMIDIFY)) { | |
| log.debug("Have filled waterskin(s); not casting Humidify because not all Waterskins are empty"); | |
| return false; | |
| } | |
| log.debug("Cannot cast Humidify; dropping empty waterskin(s)"); | |
| Rs2Inventory.drop(ItemID.WATERSKIN0); | |
| Global.sleep(300, 500); | |
| return true; |
🤖 Prompt for AI Agents
In
runelite-client/src/main/java/net/runelite/client/plugins/microbot/agility/courses/PyramidCourse.java
around lines 1206 to 1231, after computing hasFilled, add a guard that if the
inventory is full and there is at least one empty waterskin (hasEmpty) then drop
a single empty waterskin immediately (to free a slot) regardless of Humidify
availability; place this check before the Humidify-casting branches so the bot
won't stall when inventory is full with mixed waterskins.
There was a problem hiding this comment.
Silly rabbit. If someone wants to carry 28 waterskins, that’s their fault!
There was a problem hiding this comment.
@heap-overfl0w Fair enough! 🐰 You're right that carrying 28 waterskins would be quite the inventory management choice. I'll trust users to manage their waterskin strategy sensibly. The current logic handles the normal cases well - all empty (cast Humidify) or mixed with Humidify unavailable (drop empty ones). Thanks for the feedback!