feat: Added bank IDs and container emptying utility#1675
feat: Added bank IDs and container emptying utility#1675irkedMATT wants to merge 1 commit intochsami:developmentfrom
Conversation
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
WalkthroughThis pull request adds support for new bank locations by introducing a new Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Important Action Needed: IP Allowlist UpdateIf your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:
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. Comment |
There was a problem hiding this comment.
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.
| 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; |
There was a problem hiding this comment.
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.
| 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.
|
Nice increased functionality. |
Added bank IDs for locations:
Rs2Bank API Enhancement:
emptyContainers()method to empty containers in inventory via the bank interface