Looting Bag Actions
LootingBagActions wraps the looting bag inventory widget with result-aware query and deposit methods.
Methods
isOpen()- checks the looting bag container widget.getAll(Predicate<Widget>)/getFirst(Predicate<Widget>)- query visible looting bag contents.contains(int itemId)/count(int itemId)- item presence and quantity helpers.open()- attempts to open a standard looting bag from inventory.deposit(int itemId, int amount)/deposit(Predicate<Widget>, int amount)- dispatches inventory deposit actions after validating amount.
Behavior notes:
- Deposit methods require the game/client inventory state to be available.
- The implementation stays shallow and widget/action based; it does not infer Wilderness-only rule state.
Open And Inspect Contents
Open the bag before using content queries. contains and count read the open
looting bag widget; they do not open it implicitly.
if (!LootingBagActions.isOpen()) {
InteractionResult open = LootingBagActions.open();
if (open.failed()) {
log.debug("Could not open looting bag: {}", open.getMessage());
return;
}
}
int natureRunes = LootingBagActions.count(561);
if (natureRunes < 100) {
log.debug("Need more nature runes in the looting bag");
}
Deposit By Item ID
Use the amount-specific helper when the item ID is known.
InteractionResult result = LootingBagActions.deposit(561, 10);
if (result.failed()) {
log.debug("Looting bag deposit failed: {}", result.getMessage());
}
Deposit By Predicate
Predicate deposits are useful when the item ID can vary but the inventory widget shape is enough to identify the target.
InteractionResult result = LootingBagActions.deposit(
widget -> widget.getItemId() > 0 && widget.getItemQuantity() >= 100,
1
);