Class Bank
- java.lang.Object
-
- com.runemate.game.api.hybrid.local.hud.interfaces.Bank
-
public final class Bank extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Bank.DefaultQuantity
static class
Bank.DefaultWithdrawQuantity
Deprecated.useBank.DefaultQuantity
insteadstatic class
Bank.WithdrawMode
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static boolean
close()
Closes the bank if openstatic boolean
close(boolean hotkey)
static boolean
contains(int id)
Checks if any items match the given idstatic boolean
contains(java.lang.String name)
Checks if any items match the given namestatic boolean
contains(java.util.function.Predicate<SpriteItem> filter)
Checks if any items match the givenfilter
static boolean
contains(java.util.regex.Pattern name)
Checks if any items match the given namestatic boolean
containsAllOf(int... ids)
Checks if all of the supplied ids match at least one item eachstatic boolean
containsAllOf(java.lang.String... names)
Checks if all of the supplied names match at least one item eachstatic boolean
containsAllOf(java.util.function.Predicate<SpriteItem> predicate)
Checks if the suppliedfilter
matches at least one itemstatic boolean
containsAllOf(java.util.function.Predicate<SpriteItem>... filters)
Checks if all of the suppliedfilter
s match at least one item eachstatic boolean
containsAllOf(java.util.regex.Pattern... names)
Checks if all of the supplied names match at least one item eachstatic boolean
containsAnyExcept(int... ids)
Checks if any items don't match the given idsstatic boolean
containsAnyExcept(java.lang.String... names)
Checks if any items don't match the given namesstatic boolean
containsAnyExcept(java.util.function.Predicate<SpriteItem> filter)
Checks if any items don't match the givenfilter
static boolean
containsAnyExcept(java.util.function.Predicate<SpriteItem>... filters)
Checks if any items don't match the givenfilter
sstatic boolean
containsAnyExcept(java.util.regex.Pattern... names)
Checks if any items don't match the given namesstatic boolean
containsAnyOf(int... ids)
Checks if any item matches the given idsstatic boolean
containsAnyOf(java.lang.String... names)
Checks if any item matches the given namesstatic boolean
containsAnyOf(java.util.function.Predicate<SpriteItem> filter)
Checks if any item matches the givenfilter
static boolean
containsAnyOf(java.util.function.Predicate<SpriteItem>... filters)
Checks if any item matches the givenfilter
sstatic boolean
containsAnyOf(java.util.regex.Pattern... names)
Checks if any item matches the given namesstatic boolean
containsOnly(java.lang.String... names)
Checks if all of the items match the given namesstatic boolean
containsOnly(java.util.function.Predicate<SpriteItem> filter)
Checks if all of the items match the givenfilter
static boolean
containsOnly(java.util.function.Predicate<SpriteItem>... filters)
Checks if all of the items match the givenfilter
sstatic boolean
containsOnly(java.util.regex.Pattern... names)
Checks if all of the items match the given namesstatic boolean
deposit(int id, int amount)
static boolean
deposit(SpriteItem item, int amount)
static boolean
deposit(java.lang.String name, int amount)
static boolean
deposit(java.util.function.Predicate<SpriteItem> filter, int amount)
Deposits the first item that matches the specified filter.static boolean
deposit(java.util.regex.Pattern name, int amount)
static boolean
depositAllExcept(int... ids)
static boolean
depositAllExcept(java.lang.String... names)
static boolean
depositAllExcept(java.util.function.Predicate<SpriteItem> exclusion)
Deposits all of the items except those that match the exclusions filter.static boolean
depositAllExcept(java.util.regex.Pattern... names)
static boolean
depositEquipment()
Clicks the deposit worn items buttonstatic boolean
depositInventory()
Clicks the deposit inventory button and waitsstatic boolean
depositInventoryOfBeastOfBurden()
Deposits the Beast of Burden Inventorystatic boolean
depositInventoryOfBeastOfBurden(boolean keybind)
Deposits the Beast of Burden Inventorystatic boolean
depositMoneyPouch()
static boolean
equip(SpriteItem item)
Equips the item directly from the bank (RS3 Only)static InteractableRectangle
getBoundsOf(int index)
static int
getCurrentTab()
Gets the currently opened bank tab where 0 is the main tabstatic Bank.DefaultQuantity
getDefaultQuantity()
static Bank.DefaultWithdrawQuantity
getDefaultWithdrawQuantity()
Deprecated.replaced bygetDefaultQuantity()
static int
getDefaultWithdrawQuantityActual()
Deprecated.usegetExactDefaultQuantity()
insteadstatic int
getExactDefaultQuantity()
static SpriteItem
getItemIn(int slot)
static SpriteItemQueryResults
getItems()
static SpriteItemQueryResults
getItems(int... ids)
static SpriteItemQueryResults
getItems(java.lang.String... names)
static SpriteItemQueryResults
getItems(java.util.function.Predicate<SpriteItem> filter)
static SpriteItemQueryResults
getItems(java.util.regex.Pattern... names)
static int
getQuantity()
Gets the total quantity of itemsstatic int
getQuantity(int... ids)
Gets the total quantity of items matching the idsstatic int
getQuantity(java.lang.String... names)
Gets the total quantity of items matching the namesstatic int
getQuantity(java.util.function.Predicate<SpriteItem> filter)
Gets the total quantity of items matching the filterstatic int
getQuantity(java.util.function.Predicate<SpriteItem>... filters)
Gets the total quantity of items matching thefilter
sstatic int
getQuantity(java.util.regex.Pattern... names)
Gets the total quantity of items matching the namesstatic java.util.List<InteractableRectangle>
getSlotBounds()
static int
getTabContaining(@NonNull SpriteItem item)
Returns the index of the bank tab containing `item`, where `0` is the main tabstatic InteractableRectangle
getViewport()
static Bank.WithdrawMode
getWithdrawMode()
static boolean
isEmpty()
static boolean
isOpen()
static boolean
isUsingCachedContents()
static boolean
isUsingCachedContents(com.runemate.game.api.script.framework.AbstractBot bot)
static boolean
loadPreset(int number)
Loads the specified preset from inside the bank using a player unique technique.static boolean
loadPreset(int number, boolean keypad)
Loads the specified preset from inside the bank using the method specified.static SpriteItemQueryBuilder
newQuery()
static boolean
open()
Opens the nearest visible bank.static boolean
open(LocatableEntity bank)
Opens the specified bank.static boolean
open(LocatableEntity bank, java.lang.String action)
Opens the specified bank with the specified action if it's visible.static boolean
open(LocatableEntity bank, java.util.regex.Pattern action)
Opens the specified bank with the specified action if it's visible.static boolean
openFirstTab()
static boolean
setDefaultQuantity(int quantity)
Sets the "Default Quantity" when left-clicking inside the OSRS bank.static boolean
setDefaultQuantity(Bank.DefaultQuantity quantity)
static boolean
setDefaultWithdrawQuantity(int quantity)
Deprecated.use setDefaultQuantitystatic boolean
setDefaultWithdrawQuantity(Bank.DefaultWithdrawQuantity quantity)
Deprecated.use setDefaultQuantity insteadstatic boolean
setWithdrawMode(Bank.WithdrawMode mode)
static void
useCachedContents(boolean enable)
static void
useCachedContents(com.runemate.game.api.script.framework.AbstractBot bot, boolean enable)
static boolean
withdraw(int id, int amount)
static boolean
withdraw(SpriteItem item, int amount)
Withdraws the specified quantity of an item from the bankstatic boolean
withdraw(java.lang.String name, int amount)
Withdraws the item with the specified namestatic boolean
withdraw(java.util.function.Predicate<SpriteItem> filter, int amount)
Withdraws the first item matching the specified filter.static boolean
withdraw(java.util.regex.Pattern name, int amount)
static boolean
withdrawToBeastOfBurden(SpriteItem item, int amount)
static boolean
withdrawToBeastOfBurden(java.lang.String name, int amount)
Withdraws the specified item directly to the Beast of Burden if available.static boolean
withdrawToBeastOfBurden(java.util.function.Predicate<SpriteItem> filter, int amount)
Withdraws the specified item directly to the Beast of Burden if available.static boolean
withdrawToBeastOfBurden(java.util.regex.Pattern name, int amount)
-
-
-
Method Detail
-
newQuery
public static SpriteItemQueryBuilder newQuery()
-
isOpen
public static boolean isOpen()
-
open
public static boolean open()
Opens the nearest visible bank. If the bank is already opened, this method will return true and do nothing.
-
open
public static boolean open(LocatableEntity bank)
Opens the specified bank. If the bank is already opened, this method will return true and do nothing.
-
open
public static boolean open(LocatableEntity bank, java.lang.String action)
Opens the specified bank with the specified action if it's visible. If the bank is already opened, this method will return true and do nothing.
-
open
public static boolean open(LocatableEntity bank, java.util.regex.Pattern action)
Opens the specified bank with the specified action if it's visible. If the bank is already opened, this method will return true and do nothing.
-
close
public static boolean close()
Closes the bank if open
-
close
public static boolean close(boolean hotkey)
-
deposit
public static boolean deposit(java.lang.String name, int amount)
-
deposit
public static boolean deposit(int id, int amount)
-
getCurrentTab
public static int getCurrentTab()
Gets the currently opened bank tab where 0 is the main tab
-
deposit
public static boolean deposit(java.util.function.Predicate<SpriteItem> filter, int amount)
Deposits the first item that matches the specified filter. If amount is equal to 0 it will deposit all of the item. If amount is equal to -1 it will deposit all of the item
-
deposit
public static boolean deposit(java.util.regex.Pattern name, int amount)
-
deposit
public static boolean deposit(SpriteItem item, int amount)
-
depositAllExcept
public static boolean depositAllExcept(java.util.regex.Pattern... names)
-
depositAllExcept
public static boolean depositAllExcept(java.lang.String... names)
-
depositAllExcept
public static boolean depositAllExcept(int... ids)
-
depositAllExcept
public static boolean depositAllExcept(java.util.function.Predicate<SpriteItem> exclusion)
Deposits all of the items except those that match the exclusions filter. If exclusions is null, it redirects to the depositInventory() method.- Returns:
- true if ALL of the items that don't match the filter are deposited successfully.
-
withdraw
public static boolean withdraw(java.lang.String name, int amount)
Withdraws the item with the specified name
-
withdraw
public static boolean withdraw(int id, int amount)
-
withdraw
public static boolean withdraw(java.util.regex.Pattern name, int amount)
-
withdraw
public static boolean withdraw(java.util.function.Predicate<SpriteItem> filter, int amount)
Withdraws the first item matching the specified filter. To withdraw all of a specific item pass in 0 for the amount
-
withdraw
public static boolean withdraw(SpriteItem item, int amount)
Withdraws the specified quantity of an item from the bank- Parameters:
item
- theSpriteItem
to be withdrawnamount
- The amount of the item to withdraw, or 0 to withdraw all, or -1 to withdraw all but one.- Returns:
- true if it was able to successfully withdraw the item
-
getTabContaining
public static int getTabContaining(@NonNull @NonNull SpriteItem item)
Returns the index of the bank tab containing `item`, where `0` is the main tab- Parameters:
item
- theSpriteItem
to lookup- Returns:
- index of the containing bank tab.
-
withdrawToBeastOfBurden
@RS3Only public static boolean withdrawToBeastOfBurden(java.lang.String name, int amount)
Withdraws the specified item directly to the Beast of Burden if available. To withdraw all of a specific item pass in 0 for the amount
-
withdrawToBeastOfBurden
@RS3Only public static boolean withdrawToBeastOfBurden(java.util.regex.Pattern name, int amount)
-
withdrawToBeastOfBurden
@RS3Only public static boolean withdrawToBeastOfBurden(java.util.function.Predicate<SpriteItem> filter, int amount)
Withdraws the specified item directly to the Beast of Burden if available. To withdraw all of a specific item pass in 0 for the amount
-
withdrawToBeastOfBurden
@RS3Only public static boolean withdrawToBeastOfBurden(SpriteItem item, int amount)
-
isUsingCachedContents
public static boolean isUsingCachedContents()
-
useCachedContents
public static void useCachedContents(boolean enable)
-
isUsingCachedContents
public static boolean isUsingCachedContents(com.runemate.game.api.script.framework.AbstractBot bot)
-
useCachedContents
public static void useCachedContents(com.runemate.game.api.script.framework.AbstractBot bot, boolean enable)
-
getItems
public static SpriteItemQueryResults getItems()
-
getItems
public static SpriteItemQueryResults getItems(java.util.function.Predicate<SpriteItem> filter)
-
getItems
public static SpriteItemQueryResults getItems(int... ids)
-
getItems
public static SpriteItemQueryResults getItems(java.lang.String... names)
-
openFirstTab
public static boolean openFirstTab()
-
getItems
public static SpriteItemQueryResults getItems(java.util.regex.Pattern... names)
-
contains
public static boolean contains(java.util.function.Predicate<SpriteItem> filter)
Checks if any items match the givenfilter
- Parameters:
filter
- the predicate to check the items against- Returns:
- true if an item matches the filter
-
contains
public static boolean contains(int id)
Checks if any items match the given id- Parameters:
id
- the id to check the items against- Returns:
- true if an item matches the id
-
contains
public static boolean contains(java.lang.String name)
Checks if any items match the given name- Parameters:
name
- the name to check the items against- Returns:
- true if an item matches the name
-
contains
public static boolean contains(java.util.regex.Pattern name)
Checks if any items match the given name- Parameters:
name
- the name to check the items against- Returns:
- true if an item matches the name
-
containsAllOf
public static boolean containsAllOf(java.util.function.Predicate<SpriteItem> predicate)
Checks if the suppliedfilter
matches at least one item- Parameters:
predicate
- the predicate to check the items against- Returns:
- true if the predicate matches an item
-
containsAllOf
@SafeVarargs public static boolean containsAllOf(java.util.function.Predicate<SpriteItem>... filters)
Checks if all of the suppliedfilter
s match at least one item each- Parameters:
filters
- the predicates to check the items against- Returns:
- true if all of the predicates have a match
-
containsAllOf
public static boolean containsAllOf(int... ids)
Checks if all of the supplied ids match at least one item each- Parameters:
ids
- the ids to check the items against- Returns:
- true if all of the ids have a match
-
containsAllOf
public static boolean containsAllOf(java.lang.String... names)
Checks if all of the supplied names match at least one item each- Parameters:
names
- the names to check the items against- Returns:
- true if all of the names have a match
-
containsAllOf
public static boolean containsAllOf(java.util.regex.Pattern... names)
Checks if all of the supplied names match at least one item each- Parameters:
names
- the names to check the items against- Returns:
- true if all of the names have a match
-
containsAnyExcept
public static boolean containsAnyExcept(java.util.function.Predicate<SpriteItem> filter)
Checks if any items don't match the givenfilter
- Parameters:
filter
- the predicate to check the items against- Returns:
- true if at least one item doesn't match the filter
-
containsAnyExcept
@SafeVarargs public static boolean containsAnyExcept(java.util.function.Predicate<SpriteItem>... filters)
Checks if any items don't match the givenfilter
s- Parameters:
filters
- the predicates to check the items against- Returns:
- true if at least one item doesn't match the filters
-
containsAnyExcept
public static boolean containsAnyExcept(int... ids)
Checks if any items don't match the given ids- Parameters:
ids
- the ids to check the items against- Returns:
- true if at least one item doesn't match the ids
-
containsAnyExcept
public static boolean containsAnyExcept(java.lang.String... names)
Checks if any items don't match the given names- Parameters:
names
- the names to check the items against- Returns:
- true if at least one item doesn't match the names
-
containsAnyExcept
public static boolean containsAnyExcept(java.util.regex.Pattern... names)
Checks if any items don't match the given names- Parameters:
names
- the names to check the items against- Returns:
- true if at least one item doesn't match the names
-
containsAnyOf
public static boolean containsAnyOf(java.util.function.Predicate<SpriteItem> filter)
Checks if any item matches the givenfilter
- Parameters:
filter
- the filter to check the items against- Returns:
- true if at least one item matches the filter
-
containsAnyOf
@SafeVarargs public static boolean containsAnyOf(java.util.function.Predicate<SpriteItem>... filters)
Checks if any item matches the givenfilter
s- Parameters:
filters
- the filters to check the items against- Returns:
- true if at least one item matches a filter
-
containsAnyOf
public static boolean containsAnyOf(int... ids)
Checks if any item matches the given ids- Parameters:
ids
- the ids to check the items against- Returns:
- true if at least one item matches an id
-
containsAnyOf
public static boolean containsAnyOf(java.lang.String... names)
Checks if any item matches the given names- Parameters:
names
- the names to check the items against- Returns:
- true if at least one item matches a name
-
containsAnyOf
public static boolean containsAnyOf(java.util.regex.Pattern... names)
Checks if any item matches the given names- Parameters:
names
- the names to check the items against- Returns:
- true if at least one item matches a name
-
containsOnly
public static boolean containsOnly(java.util.function.Predicate<SpriteItem> filter)
Checks if all of the items match the givenfilter
- Parameters:
filter
- the filter to check the items against- Returns:
- true if all items match the filter
-
containsOnly
@SafeVarargs public static boolean containsOnly(java.util.function.Predicate<SpriteItem>... filters)
Checks if all of the items match the givenfilter
s- Parameters:
filters
- the filters to check the items against- Returns:
- true if all items match at least one filter each
-
containsOnly
public static boolean containsOnly(java.lang.String... names)
Checks if all of the items match the given names- Parameters:
names
- the filters to check the items against- Returns:
- true if all items match at least one name each
-
containsOnly
public static boolean containsOnly(java.util.regex.Pattern... names)
Checks if all of the items match the given names- Parameters:
names
- the filters to check the items against- Returns:
- true if all items match at least one name each
-
getQuantity
public static int getQuantity()
Gets the total quantity of items- Returns:
- the total quantity of items
-
getQuantity
public static int getQuantity(java.util.function.Predicate<SpriteItem> filter)
Gets the total quantity of items matching the filter- Parameters:
filter
- the filter to check the items against- Returns:
- the total quantity of items matching the filter
-
getQuantity
@SafeVarargs public static int getQuantity(java.util.function.Predicate<SpriteItem>... filters)
Gets the total quantity of items matching thefilter
s- Parameters:
filters
- the filters to check the items against- Returns:
- the total quantity of items matching the filters
-
getQuantity
public static int getQuantity(int... ids)
Gets the total quantity of items matching the ids- Parameters:
ids
- the ids to check the items against- Returns:
- the total quantity of items matching the ids
-
getQuantity
public static int getQuantity(java.lang.String... names)
Gets the total quantity of items matching the names- Parameters:
names
- the ids to check the items against- Returns:
- the total quantity of items matching the names
-
getQuantity
public static int getQuantity(java.util.regex.Pattern... names)
Gets the total quantity of items matching the names- Parameters:
names
- the ids to check the items against- Returns:
- the total quantity of items matching the names
-
isEmpty
public static boolean isEmpty()
-
getItemIn
public static SpriteItem getItemIn(int slot)
-
getViewport
public static InteractableRectangle getViewport()
-
getSlotBounds
public static java.util.List<InteractableRectangle> getSlotBounds()
-
getBoundsOf
public static InteractableRectangle getBoundsOf(int index)
-
loadPreset
@RS3Only public static boolean loadPreset(int number)
Loads the specified preset from inside the bank using a player unique technique.- Parameters:
number
- The number of the preset to load (1 or 2)- Returns:
- Whether or not we successfully performed the load action
-
loadPreset
@RS3Only public static boolean loadPreset(int number, boolean keypad)
Loads the specified preset from inside the bank using the method specified.- Parameters:
number
- The number of the preset to load (1 or 2)keypad
- Use the keypad or click the button- Returns:
- Whether or not we successfully performed the load action
-
equip
@RS3Only public static boolean equip(SpriteItem item)
Equips the item directly from the bank (RS3 Only)- Returns:
- true if the quantity of the specified item changed.
-
depositInventory
public static boolean depositInventory()
Clicks the deposit inventory button and waits- Returns:
- true if the entire inventory was deposited
-
depositEquipment
public static boolean depositEquipment()
Clicks the deposit worn items button- Returns:
- true if all equipment was deposited
-
depositInventoryOfBeastOfBurden
@RS3Only public static boolean depositInventoryOfBeastOfBurden()
Deposits the Beast of Burden Inventory
-
depositInventoryOfBeastOfBurden
@RS3Only public static boolean depositInventoryOfBeastOfBurden(boolean keybind)
Deposits the Beast of Burden Inventory- Parameters:
keybind
- Use the keybind or click the button- Returns:
- Whether or not we successfully deposited the Beast of Burden Inventory
-
depositMoneyPouch
@RS3Only public static boolean depositMoneyPouch()
-
getWithdrawMode
public static Bank.WithdrawMode getWithdrawMode()
-
setWithdrawMode
public static boolean setWithdrawMode(Bank.WithdrawMode mode)
-
setDefaultWithdrawQuantity
@OSRSOnly @Deprecated public static boolean setDefaultWithdrawQuantity(Bank.DefaultWithdrawQuantity quantity)
Deprecated.use setDefaultQuantity insteadSets the "Default Withdraw Quantity" when left-clicking inside the OSRS bank.It's recommended to use
setDefaultWithdrawQuantity(int)
if you want to use a number other than 1, 5, 10 or All.Currently only an OSRS feature.
- Parameters:
quantity
- - the DefaultWithdrawQuantity representing the quantity to be withdrawn.- Returns:
- true if the DefaultWithdrawQuantity has been set, false otherwise.
-
setDefaultQuantity
public static boolean setDefaultQuantity(Bank.DefaultQuantity quantity)
-
setDefaultQuantity
public static boolean setDefaultQuantity(int quantity)
Sets the "Default Quantity" when left-clicking inside the OSRS bank.Currently only an OSRS feature.
- Parameters:
quantity
- - the DefaultQuantity representing the quantity to be withdrawn.- Returns:
- true if the DefaultwQuantity has been set, false otherwise.
-
setDefaultWithdrawQuantity
@Deprecated public static boolean setDefaultWithdrawQuantity(int quantity)
Deprecated.use setDefaultQuantitySets the "Default Withdraw Quantity" when left-clicking inside the OSRS bank.- Parameters:
quantity
- - the DefaultWithdrawQuantity representing the quantity to be withdrawn.- Returns:
- true if the DefaultWithdrawQuantity has been set, false otherwise.
-
getDefaultWithdrawQuantity
@OSRSOnly @Deprecated public static Bank.DefaultWithdrawQuantity getDefaultWithdrawQuantity()
Deprecated.replaced bygetDefaultQuantity()
-
getDefaultQuantity
public static Bank.DefaultQuantity getDefaultQuantity()
-
getDefaultWithdrawQuantityActual
@OSRSOnly @Deprecated public static int getDefaultWithdrawQuantityActual()
Deprecated.usegetExactDefaultQuantity()
insteadReturns the "actual" default withdraw quantity (1, 5, 14 etc..) rather than theBank.DefaultWithdrawQuantity
object representing the menu.- Returns:
- the selected default withdraw quantity or Integer.MIN_VALUE if the Varbit cannot be loaded.
-
getExactDefaultQuantity
public static int getExactDefaultQuantity()
-
-