Skip to content

feat: Added bank IDs and container emptying utility#1675

Open
irkedMATT wants to merge 1 commit intochsami:developmentfrom
irkedMATT:feat-Adds-newbankIDs-emptyContainers
Open

feat: Added bank IDs and container emptying utility#1675
irkedMATT wants to merge 1 commit intochsami:developmentfrom
irkedMATT:feat-Adds-newbankIDs-emptyContainers

Conversation

@irkedMATT
Copy link
Contributor

Added bank IDs for locations:

  • SUNBLEAK_ISLAND
  • DEEPFIN_POINT
  • DEEPFIN_MINE_MID
  • DEEPFIN_MINE_EAST
  • CHARRED_ISLAND

Rs2Bank API Enhancement:

  • Added emptyContainers() method to empty containers in inventory via the bank interface
  • Uses widget ID 786471 to trigger the empty containers action

Added bank IDs for locations:
- SUNBLEAK_ISLAND
- DEEPFIN_POINT
- DEEPFIN_MINE_MID
- DEEPFIN_MINE_EAST
- CHARRED_ISLAND

Rs2Bank API Enhancement:
- Added `emptyContainers()` method to empty containers in inventory via the bank interface
- Uses widget ID 786471 to trigger the empty containers action
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 4, 2026

Walkthrough

This pull request adds support for new bank locations by introducing a new emptyContainers() method to the Rs2Bank utility class and expanding the bank ID registry. The new method enables interaction with the Empty containers button widget (ID 786471) when the bank interface is open, returning true on success or false if preconditions fail. Simultaneously, five new bank IDs are appended to Rs2BankID.bankIds to support banks at Charred Island, Sunbleak, and Deepfin locations.

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: addition of bank IDs and a new container emptying utility method to the Rs2Bank API.
Description check ✅ Passed The description clearly explains both changes: the new bank IDs for specific island locations and the emptyContainers() method with its widget ID implementation detail.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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: 1

🤖 Fix all issues with AI agents
In
`@runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/bank/Rs2Bank.java`:
- Around line 1104-1110: The emptyContainers() method currently clicks the
widget returned by Rs2Widget.getWidget(786471) and always returns true; change
it to capture the boolean result of Rs2Widget.clickWidget(widget) and only
proceed to the sleep/return true if that click returned true, otherwise return
false; additionally, after a successful click, add a short confirmation using a
state check (e.g., sleepUntil or checking the widget/state that indicates
containers are empty) before returning true so callers can reliably detect
success.

Comment on lines +1104 to +1110
Widget widget = Rs2Widget.getWidget(786471); // Empty containers button ID
if (widget == null) return false;

Rs2Widget.clickWidget(widget);
sleep(1000, 2000); // Wait for containers to be emptied

return true;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Check the click result before reporting success.
emptyContainers() returns true even if the widget click fails, so callers can’t distinguish failure from success. Capture the click result (and optionally add a state confirmation) before returning success.

🛠️ Proposed fix
-		Rs2Widget.clickWidget(widget);
-		sleep(1000, 2000); // Wait for containers to be emptied
-		
-		return true;
+		boolean clicked = Rs2Widget.clickWidget(widget);
+		if (!clicked) return false;
+		sleep(1000, 2000); // Wait for containers to be emptied
+		return true;

As per coding guidelines, verify interaction success by checking return values and using sleepUntil for state confirmation.

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

Suggested change
Widget widget = Rs2Widget.getWidget(786471); // Empty containers button ID
if (widget == null) return false;
Rs2Widget.clickWidget(widget);
sleep(1000, 2000); // Wait for containers to be emptied
return true;
Widget widget = Rs2Widget.getWidget(786471); // Empty containers button ID
if (widget == null) return false;
boolean clicked = Rs2Widget.clickWidget(widget);
if (!clicked) return false;
sleep(1000, 2000); // Wait for containers to be emptied
return true;
🤖 Prompt for AI Agents
In
`@runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/bank/Rs2Bank.java`
around lines 1104 - 1110, The emptyContainers() method currently clicks the
widget returned by Rs2Widget.getWidget(786471) and always returns true; change
it to capture the boolean result of Rs2Widget.clickWidget(widget) and only
proceed to the sleep/return true if that click returned true, otherwise return
false; additionally, after a successful click, add a short confirmation using a
state check (e.g., sleepUntil or checking the widget/state that indicates
containers are empty) before returning true so callers can reliably detect
success.

@Sunny-P
Copy link
Contributor

Sunny-P commented Feb 4, 2026

Nice increased functionality.
If I could add a suggestion; I would propose that instead of using an interface ID to find the empty container Widget, use a sprite ID - the same way the empty inventory and equipment buttons are found. This is a more more resilient way so it is less likely to breaking in future, as any changes/updates made to the bank in future will more likely change interface IDs around, but still use the same sprite ID.

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