Class Bank


  • public final class Bank
    extends java.lang.Object
    • Method Detail

      • 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 - the SpriteItem to be withdrawn
        amount - 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 - the SpriteItem 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)
      • openFirstTab

        public static boolean openFirstTab()
      • contains

        public static boolean contains​(java.util.function.Predicate<SpriteItem> filter)
        Checks if any items match the given filter
        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 supplied filter 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 supplied filters 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 given filter
        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 given filters
        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 given filter
        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 given filters
        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 given filter
        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 given filters
        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 the filters
        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)
      • 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()
      • setWithdrawMode

        public static boolean setWithdrawMode​(Bank.WithdrawMode mode)
      • setDefaultWithdrawQuantity

        @OSRSOnly
        @Deprecated
        public static boolean setDefaultWithdrawQuantity​(Bank.DefaultWithdrawQuantity quantity)
        Deprecated.
        use setDefaultQuantity instead
        Sets 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​(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 setDefaultQuantity
        Sets 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.
      • getDefaultWithdrawQuantityActual

        @OSRSOnly
        @Deprecated
        public static int getDefaultWithdrawQuantityActual()
        Deprecated.
        Returns the "actual" default withdraw quantity (1, 5, 14 etc..) rather than the Bank.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()