Package net.storm.sdk.items
Class Bank
java.lang.Object
net.storm.sdk.items.Bank
Static utility class for interacting with the player's bank.
The bank is a storage system where players can store items. This class provides methods to open the bank, deposit and withdraw items, manage bank tabs, and query bank contents.
Example usage:
// Open the nearest bank
Bank.open();
// Wait for bank to open and deposit all items
if (Bank.isOpen()) {
Bank.depositInventory();
}
// Withdraw specific items
Bank.withdraw("Lobster", 10);
Bank.withdrawAll("Coins");
// Check if bank contains items
if (Bank.contains("Dragon bones")) {
int count = Bank.getCount(true, "Dragon bones");
}
// Use quantity modes
Bank.setQuantityMode(Bank.QuantityMode.ALL);
// Work with bank tabs
if (Bank.hasTabs()) {
Bank.openTab(1);
}
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration of bank interface widget components.static classNested utility class for interacting with the inventory panel while the bank is open.static enumEnumeration of bank withdraw quantity modes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclose()Closes the bank interface.static voidcollapseTab(int index) Collapses a specific bank tab by index, moving its items to the main tab.static voidCollapses all bank tabs, moving their items to the main tab.static booleancontains(int... id) Checks if the bank contains any item matching any of the specified IDs.static booleanChecks if the bank contains any item matching any of the specified names.static booleanChecks if the bank contains any item matching the specified filter.static booleancontainsAll(int... ids) Checks if the bank contains all items with the specified IDs.static booleancontainsAll(String... names) Checks if the bank contains all items with the specified names.static voiddeposit(int id, int amount) Deposits a specific amount of an item by ID.static voidDeposits a specific amount of an item by name.static voidDeposits a specific amount of items matching the filter.static voiddepositAll(int... ids) Deposits all items matching the specified IDs from inventory into the bank.static voiddepositAll(String... names) Deposits all items matching the specified names from inventory into the bank.static voiddepositAll(Predicate<? super IItem> filter) Deposits all items matching the filter from inventory into the bank.static voiddepositAllExcept(int... ids) Deposits all items except those matching the specified IDs.static voiddepositAllExcept(String... names) Deposits all items except those matching the specified names.static voiddepositAllExcept(Predicate<? super IItem> filter) Deposits all items except those matching the filter.static voidDeposits all equipped items into the bank.static voidDeposits all items from the player's inventory into the bank.static voidEmpties all containers (such as looting bag, seed box) into the bank.static IBankItemget(int slot) Gets the bank item at the specified slot.getAll()Gets all items currently in the bank.getAll(int... ids) Gets all items in the bank matching any of the specified IDs.Gets all items in the bank matching any of the specified names.Gets all items in the bank matching the specified filter.static intGets the total capacity of the bank.static intgetCount(boolean stacks, int... ids) Counts items in the bank matching any of the specified IDs.static intCounts items in the bank matching any of the specified names.static intCounts items in the bank matching the filter.static intgetCount(int... ids) Counts the number of item stacks matching any of the specified IDs.static intCounts the number of item stacks matching any of the specified names.static intCounts the number of item stacks matching the filter.static IBankItemgetFirst(int... ids) Gets the first item in the bank matching any of the specified IDs.static IBankItemGets the first item in the bank matching any of the specified names.static IBankItemGets the first item in the bank matching the specified filter.static intGets the number of free slots available in the bank.static IBankItemgetLast(int... ids) Gets the last item in the bank matching any of the specified IDs.static IBankItemGets the last item in the bank matching any of the specified names.static IBankItemGets the last item in the bank matching the specified filter.static intGets the number of occupied slots in the bank.static Bank.QuantityModeGets the current withdraw quantity mode setting.getTabs()Gets all bank tab widgets.static booleanhasTabs()Checks if the bank has any custom tabs configured.static booleanisEmpty()Checks if the bank contains no items.static booleanChecks if the main bank tab is currently selected.static booleanChecks if the current withdraw mode is set to noted.static booleanisOpen()Checks if the bank interface is currently open.static booleanChecks if the bank PIN entry screen is currently displayed.static booleanChecks if the bank settings menu is currently open.static booleanisTabOpen(int index) Checks if a specific bank tab is currently selected.static voidopen()Opens the nearest bank to the player.static voidopen(net.runelite.api.coords.WorldArea area) Opens a bank within the specified world area.static voidopen(net.runelite.api.coords.WorldArea area, int offset) Opens a bank within the specified area with an offset.static voidopen(net.runelite.api.coords.WorldArea area, int offset, BooleanSupplier requirements) Opens a bank within the specified area with an offset and requirements check.static voidopen(BankLocation bankLocation) Opens a bank at the specified bank location.static voidOpens the main bank tab, showing all items.static voidopenTab(int index) Opens a specific bank tab by index.static voidquickDeposit(int id, int amount) Quickly deposits a specific amount of an item by ID using optimized interactions.static voidquickDeposit(String name, int amount) Quickly deposits a specific amount of an item by name using optimized interactions.static voidquickDeposit(Predicate<IItem> filter, int amount) Quickly deposits a specific amount of items matching the filter using optimized interactions.static voidquickWithdraw(int id, int amount) Quickly withdraws a specific amount of an item by ID using optimized interactions.static voidquickWithdraw(int id, int amount, WithdrawMode withdrawMode) Quickly withdraws a specific amount of an item by ID with a specific withdraw mode.static voidquickWithdraw(String name, int amount) Quickly withdraws a specific amount of an item by name using optimized interactions.static voidquickWithdraw(String name, int amount, WithdrawMode withdrawMode) Quickly withdraws a specific amount of an item by name with a specific withdraw mode.static voidquickWithdraw(Predicate<IItem> filter, int amount) Quickly withdraws a specific amount of items matching the filter using optimized interactions.static voidquickWithdraw(Predicate<IItem> filter, int amount, WithdrawMode withdrawMode) Quickly withdraws a specific amount of items matching the filter with a specific withdraw mode.static voidReleases all placeholders in the bank.static voidsetQuantityMode(Bank.QuantityMode quantityMode) Sets the withdraw quantity mode for bank operations.static voidsetWithdrawMode(boolean noted) Sets whether items should be withdrawn as notes or as regular items.static voidToggles the bank settings menu open or closed.static voidwithdraw(int id, int amount) Withdraws a specific amount of an item by ID from the bank.static voidwithdraw(int id, int amount, WithdrawMode withdrawMode) Withdraws a specific amount of an item by ID with a specific withdraw mode.static voidWithdraws a specific amount of an item by name from the bank.static voidwithdraw(String name, int amount, WithdrawMode withdrawMode) Withdraws a specific amount of an item by name with a specific withdraw mode.static voidWithdraws a specific amount of items matching the filter from the bank.static voidwithdraw(Predicate<IItem> filter, int amount, WithdrawMode withdrawMode) Withdraws a specific amount of items matching the filter with a specific withdraw mode.static voidwithdrawAll(int id) Withdraws all of an item by ID from the bank.static voidwithdrawAll(int id, WithdrawMode withdrawMode) Withdraws all of an item by ID with a specific withdraw mode.static voidwithdrawAll(String name) Withdraws all of an item by name from the bank.static voidwithdrawAll(String name, WithdrawMode withdrawMode) Withdraws all of an item by name with a specific withdraw mode.static voidwithdrawAll(Predicate<IItem> filter) Withdraws all items matching the filter from the bank.static voidwithdrawAll(Predicate<IItem> filter, WithdrawMode withdrawMode) Withdraws all items matching the filter with a specific withdraw mode.static voidwithdrawLastQuantity(int id) Withdraws an item using the last used quantity setting.static voidwithdrawLastQuantity(int id, WithdrawMode withdrawMode) Withdraws an item using the last used quantity setting with a specific withdraw mode.static voidwithdrawLastQuantity(String name) Withdraws an item using the last used quantity setting.static voidwithdrawLastQuantity(String name, WithdrawMode withdrawMode) Withdraws an item using the last used quantity setting with a specific withdraw mode.static voidwithdrawLastQuantity(Predicate<IItem> filter) Withdraws items matching the filter using the last used quantity setting.static voidwithdrawLastQuantity(Predicate<IItem> filter, WithdrawMode withdrawMode) Withdraws items matching the filter using the last used quantity setting with a specific withdraw mode.
-
Constructor Details
-
Bank
public Bank()
-
-
Method Details
-
open
public static void open()Opens the nearest bank to the player.This method automatically finds the closest bank location and attempts to open it. If the bank is already open, no action is taken.
-
open
public static void open(net.runelite.api.coords.WorldArea area, int offset) Opens a bank within the specified area with an offset.- Parameters:
area- the world area containing the bankoffset- the offset to apply to the area boundaries
-
open
public static void open(net.runelite.api.coords.WorldArea area, int offset, BooleanSupplier requirements) Opens a bank within the specified area with an offset and requirements check.- Parameters:
area- the world area containing the bankoffset- the offset to apply to the area boundariesrequirements- a supplier that returns true if requirements are met to open the bank
-
open
public static void open(net.runelite.api.coords.WorldArea area) Opens a bank within the specified world area.- Parameters:
area- the world area containing the bank to open
-
open
Opens a bank at the specified bank location.- Parameters:
bankLocation- the predefined bank location to open
-
getQuantityMode
Gets the current withdraw quantity mode setting.- Returns:
- the current
Bank.QuantityMode
-
setQuantityMode
Sets the withdraw quantity mode for bank operations.- Parameters:
quantityMode- the quantity mode to set (ONE, FIVE, TEN, X, or ALL)
-
getFreeSlots
public static int getFreeSlots()Gets the number of free slots available in the bank.- Returns:
- the number of free slots, or -1 if the bank is not open
-
getCapacity
public static int getCapacity()Gets the total capacity of the bank.- Returns:
- the maximum number of item stacks the bank can hold, or -1 if unavailable
-
getOccupiedSlots
public static int getOccupiedSlots()Gets the number of occupied slots in the bank.- Returns:
- the number of slots currently containing items, or -1 if unavailable
-
releasePlaceholders
public static void releasePlaceholders()Releases all placeholders in the bank.This opens the settings menu if not already open, then triggers the release placeholders action.
-
toggleSettings
public static void toggleSettings()Toggles the bank settings menu open or closed. -
isSettingsOpen
public static boolean isSettingsOpen()Checks if the bank settings menu is currently open.- Returns:
- true if the settings menu is visible, false otherwise
-
depositInventory
public static void depositInventory()Deposits all items from the player's inventory into the bank. -
depositEquipment
public static void depositEquipment()Deposits all equipped items into the bank. -
emptyContainers
public static void emptyContainers()Empties all containers (such as looting bag, seed box) into the bank. -
isOpen
public static boolean isOpen()Checks if the bank interface is currently open.- Returns:
- true if the bank is open, false otherwise
-
isEmpty
public static boolean isEmpty()Checks if the bank contains no items.- Returns:
- true if the bank is empty, false otherwise
-
depositAll
Deposits all items matching the specified names from inventory into the bank.- Parameters:
names- the item names to deposit
-
depositAll
public static void depositAll(int... ids) Deposits all items matching the specified IDs from inventory into the bank.- Parameters:
ids- the item IDs to deposit
-
depositAll
Deposits all items matching the filter from inventory into the bank.- Parameters:
filter- the predicate to match items against
-
depositAllExcept
Deposits all items except those matching the specified names.- Parameters:
names- the item names to keep in inventory
-
depositAllExcept
public static void depositAllExcept(int... ids) Deposits all items except those matching the specified IDs.- Parameters:
ids- the item IDs to keep in inventory
-
depositAllExcept
Deposits all items except those matching the filter.- Parameters:
filter- the predicate matching items to keep in inventory
-
deposit
Deposits a specific amount of an item by name.- Parameters:
name- the name of the item to depositamount- the quantity to deposit
-
deposit
public static void deposit(int id, int amount) Deposits a specific amount of an item by ID.- Parameters:
id- the ID of the item to depositamount- the quantity to deposit
-
deposit
Deposits a specific amount of items matching the filter.- Parameters:
filter- the predicate to match items againstamount- the quantity to deposit
-
withdrawAll
Withdraws all of an item by name from the bank.- Parameters:
name- the name of the item to withdraw
-
withdrawAll
Withdraws all of an item by name with a specific withdraw mode.- Parameters:
name- the name of the item to withdrawwithdrawMode- whether to withdraw as noted or as item
-
withdrawAll
public static void withdrawAll(int id) Withdraws all of an item by ID from the bank.- Parameters:
id- the ID of the item to withdraw
-
withdrawAll
Withdraws all of an item by ID with a specific withdraw mode.- Parameters:
id- the ID of the item to withdrawwithdrawMode- whether to withdraw as noted or as item
-
withdrawAll
Withdraws all items matching the filter from the bank.- Parameters:
filter- the predicate to match items against
-
withdrawAll
Withdraws all items matching the filter with a specific withdraw mode.- Parameters:
filter- the predicate to match items againstwithdrawMode- whether to withdraw as noted or as item
-
withdraw
Withdraws a specific amount of an item by name from the bank.- Parameters:
name- the name of the item to withdrawamount- the quantity to withdraw
-
withdraw
Withdraws a specific amount of an item by name with a specific withdraw mode.- Parameters:
name- the name of the item to withdrawamount- the quantity to withdrawwithdrawMode- whether to withdraw as noted or as item
-
withdraw
public static void withdraw(int id, int amount) Withdraws a specific amount of an item by ID from the bank.- Parameters:
id- the ID of the item to withdrawamount- the quantity to withdraw
-
withdraw
Withdraws a specific amount of an item by ID with a specific withdraw mode.- Parameters:
id- the ID of the item to withdrawamount- the quantity to withdrawwithdrawMode- whether to withdraw as noted or as item
-
withdraw
Withdraws a specific amount of items matching the filter from the bank.- Parameters:
filter- the predicate to match items againstamount- the quantity to withdraw
-
withdraw
Withdraws a specific amount of items matching the filter with a specific withdraw mode.- Parameters:
filter- the predicate to match items againstamount- the quantity to withdrawwithdrawMode- whether to withdraw as noted or as item
-
quickWithdraw
Quickly withdraws a specific amount of an item by name using optimized interactions.- Parameters:
name- the name of the item to withdrawamount- the quantity to withdraw
-
quickWithdraw
Quickly withdraws a specific amount of an item by name with a specific withdraw mode.- Parameters:
name- the name of the item to withdrawamount- the quantity to withdrawwithdrawMode- whether to withdraw as noted or as item
-
quickWithdraw
public static void quickWithdraw(int id, int amount) Quickly withdraws a specific amount of an item by ID using optimized interactions.- Parameters:
id- the ID of the item to withdrawamount- the quantity to withdraw
-
quickWithdraw
Quickly withdraws a specific amount of an item by ID with a specific withdraw mode.- Parameters:
id- the ID of the item to withdrawamount- the quantity to withdrawwithdrawMode- whether to withdraw as noted or as item
-
quickWithdraw
Quickly withdraws a specific amount of items matching the filter using optimized interactions.- Parameters:
filter- the predicate to match items againstamount- the quantity to withdraw
-
quickWithdraw
Quickly withdraws a specific amount of items matching the filter with a specific withdraw mode.- Parameters:
filter- the predicate to match items againstamount- the quantity to withdrawwithdrawMode- whether to withdraw as noted or as item
-
quickDeposit
Quickly deposits a specific amount of an item by name using optimized interactions.- Parameters:
name- the name of the item to depositamount- the quantity to deposit
-
quickDeposit
public static void quickDeposit(int id, int amount) Quickly deposits a specific amount of an item by ID using optimized interactions.- Parameters:
id- the ID of the item to depositamount- the quantity to deposit
-
quickDeposit
Quickly deposits a specific amount of items matching the filter using optimized interactions.- Parameters:
filter- the predicate to match items againstamount- the quantity to deposit
-
withdrawLastQuantity
Withdraws an item using the last used quantity setting.- Parameters:
name- the name of the item to withdraw
-
withdrawLastQuantity
Withdraws an item using the last used quantity setting with a specific withdraw mode.- Parameters:
name- the name of the item to withdrawwithdrawMode- whether to withdraw as noted or as item
-
withdrawLastQuantity
public static void withdrawLastQuantity(int id) Withdraws an item using the last used quantity setting.- Parameters:
id- the ID of the item to withdraw
-
withdrawLastQuantity
Withdraws an item using the last used quantity setting with a specific withdraw mode.- Parameters:
id- the ID of the item to withdrawwithdrawMode- whether to withdraw as noted or as item
-
withdrawLastQuantity
Withdraws items matching the filter using the last used quantity setting.- Parameters:
filter- the predicate to match items against
-
withdrawLastQuantity
Withdraws items matching the filter using the last used quantity setting with a specific withdraw mode.- Parameters:
filter- the predicate to match items againstwithdrawMode- whether to withdraw as noted or as item
-
setWithdrawMode
public static void setWithdrawMode(boolean noted) Sets whether items should be withdrawn as notes or as regular items.- Parameters:
noted- true to withdraw items as notes, false for regular items
-
isNotedWithdrawMode
public static boolean isNotedWithdrawMode()Checks if the current withdraw mode is set to noted.- Returns:
- true if withdrawing as notes, false if withdrawing as items
-
getAll
Gets all items in the bank matching the specified filter.- Parameters:
filter- the predicate to match items against- Returns:
- a list of matching bank items
-
getAll
Gets all items currently in the bank.- Returns:
- a list of all bank items
-
getAll
Gets all items in the bank matching any of the specified IDs.- Parameters:
ids- the item IDs to search for- Returns:
- a list of matching bank items
-
getAll
Gets all items in the bank matching any of the specified names.- Parameters:
names- the item names to search for- Returns:
- a list of matching bank items
-
get
Gets the bank item at the specified slot.- Parameters:
slot- the slot index (0-based)- Returns:
- the bank item at the slot, or null if empty
-
getFirst
Gets the first item in the bank matching the specified filter.- Parameters:
filter- the predicate to match items against- Returns:
- the first matching bank item, or null if none found
-
getFirst
Gets the first item in the bank matching any of the specified IDs.- Parameters:
ids- the item IDs to search for- Returns:
- the first matching bank item, or null if none found
-
getFirst
Gets the first item in the bank matching any of the specified names.- Parameters:
names- the item names to search for- Returns:
- the first matching bank item, or null if none found
-
getLast
Gets the last item in the bank matching the specified filter.- Parameters:
filter- the predicate to match items against- Returns:
- the last matching bank item, or null if none found
-
getLast
Gets the last item in the bank matching any of the specified IDs.- Parameters:
ids- the item IDs to search for- Returns:
- the last matching bank item, or null if none found
-
getLast
Gets the last item in the bank matching any of the specified names.- Parameters:
names- the item names to search for- Returns:
- the last matching bank item, or null if none found
-
contains
Checks if the bank contains any item matching the specified filter.- Parameters:
filter- the predicate to match items against- Returns:
- true if at least one matching item exists, false otherwise
-
contains
public static boolean contains(int... id) Checks if the bank contains any item matching any of the specified IDs.- Parameters:
id- the item IDs to search for- Returns:
- true if at least one matching item exists, false otherwise
-
contains
Checks if the bank contains any item matching any of the specified names.- Parameters:
name- the item names to search for- Returns:
- true if at least one matching item exists, false otherwise
-
containsAll
public static boolean containsAll(int... ids) Checks if the bank contains all items with the specified IDs.- Parameters:
ids- the item IDs that must all be present- Returns:
- true if all items are present, false if any are missing
-
containsAll
Checks if the bank contains all items with the specified names.- Parameters:
names- the item names that must all be present- Returns:
- true if all items are present, false if any are missing
-
getCount
Counts items in the bank matching the filter.- Parameters:
stacks- if true, counts the total quantity of stacked items; if false, counts number of stacksfilter- the predicate to match items against- Returns:
- the count of matching items
-
getCount
public static int getCount(boolean stacks, int... ids) Counts items in the bank matching any of the specified IDs.- Parameters:
stacks- if true, counts the total quantity of stacked items; if false, counts number of stacksids- the item IDs to count- Returns:
- the count of matching items
-
getCount
Counts items in the bank matching any of the specified names.- Parameters:
stacks- if true, counts the total quantity of stacked items; if false, counts number of stacksnames- the item names to count- Returns:
- the count of matching items
-
getCount
Counts the number of item stacks matching the filter.- Parameters:
filter- the predicate to match items against- Returns:
- the number of matching item stacks
-
getCount
public static int getCount(int... ids) Counts the number of item stacks matching any of the specified IDs.- Parameters:
ids- the item IDs to count- Returns:
- the number of matching item stacks
-
getCount
Counts the number of item stacks matching any of the specified names.- Parameters:
names- the item names to count- Returns:
- the number of matching item stacks
-
getTabs
Gets all bank tab widgets.- Returns:
- a list of widgets representing bank tabs
-
hasTabs
public static boolean hasTabs()Checks if the bank has any custom tabs configured.- Returns:
- true if at least one custom tab exists, false otherwise
-
collapseTabs
public static void collapseTabs()Collapses all bank tabs, moving their items to the main tab. -
collapseTab
public static void collapseTab(int index) Collapses a specific bank tab by index, moving its items to the main tab.- Parameters:
index- the tab index to collapse (0-based, excluding main tab)
-
isMainTabOpen
public static boolean isMainTabOpen()Checks if the main bank tab is currently selected.- Returns:
- true if the main tab is open, false otherwise
-
isTabOpen
public static boolean isTabOpen(int index) Checks if a specific bank tab is currently selected.- Parameters:
index- the tab index to check (0-based, excluding main tab)- Returns:
- true if the specified tab is open, false otherwise
-
openMainTab
public static void openMainTab()Opens the main bank tab, showing all items. -
openTab
public static void openTab(int index) Opens a specific bank tab by index.- Parameters:
index- the tab index to open (0-based, excluding main tab)
-
isPinScreenOpen
public static boolean isPinScreenOpen()Checks if the bank PIN entry screen is currently displayed.- Returns:
- true if the PIN screen is open, false otherwise
-
close
public static void close()Closes the bank interface.
-