Class Bank


  • public class Bank
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static boolean addToBankHistoryCache​(Item item)
      This allows you to add an item to the bank history cache, it should only be necessary if you're doing things outside our API.
      static java.util.List<Item> all()
      Gets the items in your bank
      static java.util.List<Item> all​(Filter<Item> filter)
      A list of all the non-null items that match the given filter Filters out null before checking against the filter
      static int availableTabs()
      Gets the number of tabs currently available
      static java.awt.Rectangle calculateSlotPosition​(int slot)
      Gets the virtual position for the specified slot.
      static int capacity()
      Gets the bank's max capacity
      static boolean close()
      Exits the bank with the close button.
      static boolean contains​(int id)
      Checks if the bank contains the given ID Placeholders are ignored
      static boolean contains​(int[] ids)
      static boolean contains​(java.lang.Integer... ids)
      Checks if your collection contains at least one item which meets one of the specified ids.
      static boolean contains​(java.lang.Object o)
      Checks to see if the bank contains an item matching the given Object Placeholders are ignored
      static boolean contains​(java.lang.String string)
      Determines if bank contains an item that matches the given name.
      static boolean contains​(java.lang.String... names)
      Checks if your collection contains at least one item which meets one of the specified names.
      static boolean contains​(Filter<Item> filter)
      Checks if your collection contains at least one item which meets the specified filter.
      static boolean containsAll​(int[] ids)
      static boolean containsAll​(java.lang.Integer... ids)
      Checks if your Bank contains all of the items with specified IDs Placeholders are ignored
      static boolean containsAll​(java.lang.String... names)
      Checks if your Bank contains all of the items with names specified Placeholders are ignored
      static boolean containsAll​(java.util.Collection<?> collection)
      Checks if your bank contains all of the items in the collection
      static int count​(int id)
      Count of all the items that match the search.
      static int count​(int[] ids)
      static int count​(java.lang.Integer... ids)
      Count of all the items that match the search.
      static int count​(java.lang.String name)
      Count of all the items that match the search.
      static int count​(java.lang.String... names)
      Count of all the items that match the search.
      static int count​(BankTab tab)
      Gets the Item count for the BankTab
      static int count​(Filter<Item> filter)
      Count of all the items that match the search.
      static boolean deposit​(int id)  
      static boolean deposit​(int id, int amount)  
      static boolean deposit​(java.lang.String name)  
      static boolean deposit​(java.lang.String name, int amount)  
      static boolean deposit​(Filter<Item> filter)  
      static boolean deposit​(Filter<Item> filter, int amount)
      Deposits the first item that matches the given Filter for the given amount
      static boolean deposit​(Item item)  
      static boolean deposit​(Item item, int amount)  
      static boolean depositAll​(int id)  
      static boolean depositAll​(java.lang.String name)  
      static boolean depositAll​(Filter<Item> filter)  
      static boolean depositAll​(Item item)  
      static boolean depositAllEquipment()
      Deposits all worn equipment with the deposit all equipment button.
      static boolean depositAllExcept​(int[] ids)  
      static boolean depositAllExcept​(java.lang.Integer... ids)  
      static boolean depositAllExcept​(java.lang.String... names)  
      static boolean depositAllExcept​(Filter<Item> filter)
      Deposits all items that do not match the given Filter Will call depositAllItems() if your inventory does not contain any of the given filter (nothing to exclude)
      static boolean depositAllItems()
      Deposits all items in your inventory with the deposit all button.
      static boolean drag​(int fromSlot, int toSlot)
      Drags the item from one slot to another, either of which can be empty to simply move an item from one slot to the other
      static int emptySlotCount()
      Number of slots that do not contain an item or placeholder
      static java.util.List<Item> except​(Filter<Item> filter)
      Get all items which do not fit the given criteria.
      static int fullSlotCount()
      Number of slots that contain non-null items Includes placeholders as a full slot
      static Item get​(int id)
      Gets the first item with the given id
      static Item get​(int[] ids)
      static Item get​(java.lang.Integer... ids)
      Gets the first Item that matches one of the given ids
      static Item get​(java.lang.String name)
      Get the item for specified name.
      static Item get​(java.lang.String... names)
      Gets the first item that matches one of the given names
      static Item get​(Filter<Item> filter)
      Gets the first Item that matches the given Filter
      static java.util.List<Item> getBankHistoryCache()
      Gets the bank item history cache.
      static WidgetChild getChild​(int id)
      Gets the WidgetChild of the Item with the given ID
      static WidgetChild getChild​(java.lang.String name)
      Gets the WidgetChild of the Item with the given name
      static WidgetChild getChild​(Filter<Item> filter)
      Gets the WidgetChild of the Item that matches the given Filter
      static WidgetChild getChild​(Item item)
      Gets the WidgetChild of the Item based on the item's slot value
      static WidgetChild getChildForSlot​(int slot)
      Gets the WidgetChild for the given slot
      static Entity getClosestBank​(BankType type)
      Gets the nearest bank interactable based on BankType
      static BankLocation getClosestBankLocation()
      Get the closest bank location.
      static BankLocation getClosestBankLocation​(boolean includeTeleports)
      Gets the nearest bank location see BankLocation.getNearest(Tile, boolean)
      static BankTab getCurrentBankTab()
      Gets the current BankTab
      static int getCurrentTab()
      Gets the current tab that is open
      static int getCustomWithdrawAmount()  
      static BankQuantitySelection getDefaultQuantity()
      Gets the currently selected default quantity for withdraw or deposit actions
      static int getFirstEmptySlot()
      Gets the first empty slot in the bank.
      static int getFirstFullSlot()
      Gets the next full slot in your bank
      static int getIdForSlot​(int slot)
      Gets the ID of the Item in the slot.
      static Item getItemInSlot​(int slot)
      Gets item in specified slot.
      static long getLastBankHistoryCacheTick()
      Returns the last game tick (using Client.getGameTick()) of a cache update
      static long getLastBankHistoryCacheTime()
      Returns the last timestamp (using System#currentTimeMillis) of a cache update
      static java.lang.String getNameForSlot​(int slot)
      Gets the Name for the Item in the slot.
      static BankMode getRearrangeMode()
      Gets the current rearrange mode type;
      static int getRow​(Item item)
      Gets the row of the Item
      static int getScrollHeight()
      Determines the current scroll position height of the bank's scroll container.
      static int getSlot​(int id)
      Gets the slot for the item with specified ID.
      static int getSlot​(java.lang.String name)
      Gets the slot for the item with specified name.
      static int getSlot​(Filter<Item> filter)
      Gets the slot for the first item that matches the given filter
      static int getTab​(int slot)  
      static int getTab​(Item item)
      Gets the tab for the Item
      static BankMode getWithdrawMode()
      Gets the current withdraw BankMode
      static boolean isAlwaysOpenTab()  
      static boolean isCached()
      Checks if the bank has been cached.
      static boolean isEmpty()
      Checks if the bank is empty (including placeholders)
      static boolean isFull()
      Determines if bank is full.
      static boolean isLoaded()
      Checks to see if the Bank container has been loaded successfully at least once Check is done during all() call
      static boolean isOpen()
      Checks if the bank is currently open or not.
      static boolean isSlotEmpty​(int slot)
      Checks if the given slot contains an item
      static boolean isSlotFull​(int slot)
      Checks if the slot has an Item in it
      static boolean isSlotVisible​(Item item)
      Determines if the given Item's slot is visible
      static boolean needToScroll​(Item item)
      Determines if the bot needs to scroll to find the Item
      static boolean needToScrollDown​(Item item)
      Determines if it needs to scroll down for the Item to be visible
      static boolean needToScrollUp​(Item item)
      Determines if it needs to scroll up in order to see the given Item
      static boolean onlyContains​(int[] ids)
      static boolean onlyContains​(java.lang.Integer... ids)
      Checks if your Bank only contains items with the specified IDs
      static boolean onlyContains​(java.lang.String... names)
      Checks if your Bank only contains items with specified names
      static boolean onlyContains​(Filter<Item> f)
      Checks if your Bank only contains items that match the Filter
      static boolean open()
      Finds the nearest BankType and attempts to open it.
      static boolean open​(BankLocation bank)
      Opens a specific bank location, if you're not in the area it will call walk(Tile) and return false If given a null bank location, it will verify the nearest bank type's location (if we have it) If that verification fails, it will recalculate to find the nearest valid bank location.
      static boolean openTab​(int tab)
      Opens the bank tab specified
      static boolean openTab​(BankTab tab)
      Opens the BankTab specified.
      static boolean placeHoldersEnabled()
      Checks whether placeholders are currently enabled
      static void resetCache()
      This will reset the bank history cache to it's initial state
      static boolean scroll​(int id)
      Scrolls to the item with the given ID see scroll(int, BankScroll) with a random choice of scroll types
      static boolean scroll​(int id, BankScroll type)
      Scrolls to the item with the given ID using the BankScroll scroll type
      static boolean scroll​(java.lang.String name)
      Scrolls to the item with the given name see scroll(String, BankScroll) with a random BankScroll type
      static boolean scroll​(java.lang.String name, BankScroll type)
      Scrolls to the item with the given name using the given BankScroll type
      static boolean scroll​(Filter<Item> filter)
      Scrolls to the item which matches the given filter.
      static boolean scroll​(Filter<Item> filter, BankScroll type)
      Scrolls to the item which matches the given filter using the given BankScroll type
      static Item set​(int index, Item element)
      Sets an Item to the given slot Used internally, shouldn't really be touched by API users
      static void setAlwaysOpenTab​(boolean alwaysOpenTab)  
      static boolean setDefaultQuantity​(BankQuantitySelection selection)
      Sets the BankQuantitySelection for bank actions
      static boolean setRearrangeMode​(BankMode mode)
      Sets the Rearrange mode for the bank either BankMode.SWAP or BankMode.INSERT
      static void setUseBankHistoryCache​(boolean useCache)
      Set whether our methods use the Bank cache if you call a method while not in the bank
      static boolean setWithdrawMode​(BankMode mode)
      Sets the withdraw mode, either BankMode.ITEM or BankMode.NOTE
      static int size()
      Deprecated.
      static int slot​(int id)
      Deprecated.
      static int slot​(java.lang.String name)
      Deprecated.
      static int slot​(Filter<Item> filter)
      Deprecated.
      static java.awt.Rectangle slotBounds​(int slot)
      Gets the bounds of a slot
      static java.awt.Rectangle slotBounds​(Item item)
      Calls slotBounds(int) with Item.getSlot() If Item is null returns null Rectangle
      static boolean slotContains​(int slot, int[] ids)
      static boolean slotContains​(int slot, java.lang.Integer... ids)
      Checks if the slot contains an item with an ID matching one of the given ids
      static boolean slotContains​(int slot, java.lang.String... names)
      Checks if the slot contains items that matches the given names.
      static boolean slotContains​(int slot, Filter<Item> filter)
      Checks if the slot contains an item that matches the filter.
      static boolean slotContains​(int slot, Item t)
      Checks if the slot contains given Item
      static boolean slotNameContains​(int slot, java.lang.String sub)
      Checks if the slot has an item whose name contains the given sub string
      static int tabContainerWidgetId()
      Gets the ID of the WidgetChild for the tab container
      static boolean togglePlaceholders​(boolean enabled)
      Toggles whether placeholders are enabled or not
      static void updateCache()
      Used for updating the bank cache, generally reserved for internal use but can be called in a script during custom banking This will clear the bank cache and update it with all bank items
      static void updateCache​(java.util.Collection<Item> items)
      Clears the bank history cache and fills it with the given collection of items, only works if bank is open
      static int widgetChildId()
      Gets the ID of the WidgetChild for the bank interface
      static int widgetParentId()
      Gets the ID of the Widget for the bank
      static boolean withdraw​(int id)
      Withdraws one of the given item id
      static boolean withdraw​(int id, int amount)
      Withdraws an item for the id and amount given.
      static boolean withdraw​(java.lang.String name)
      Withdraws one of an item with the given name
      static boolean withdraw​(java.lang.String name, int amount)
      Withdraws an item for the name and amount given.
      static boolean withdraw​(Filter<Item> filter)
      Withdraws one item that matches the given Filter
      static boolean withdraw​(Filter<Item> filter, int amount)
      Withdraws an item that matches the given Filter for the given amount For withdraw All-but-one pass in value: -9411
      static boolean withdrawAll​(int id)
      Withdraws all of an item for a given ID
      static boolean withdrawAll​(java.lang.String name)
      Withdraws all of an item for the given name
      static boolean withdrawAll​(Filter<Item> filter)
      Withdraws all of an item that matches the given Filter
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • widgetParentId

        public static int widgetParentId()
        Gets the ID of the Widget for the bank
      • widgetChildId

        public static int widgetChildId()
        Gets the ID of the WidgetChild for the bank interface
        Returns:
      • tabContainerWidgetId

        public static int tabContainerWidgetId()
        Gets the ID of the WidgetChild for the tab container
      • capacity

        public static int capacity()
        Gets the bank's max capacity
        Returns:
        constant value (currently 1200)
      • get

        public static Item get​(Filter<Item> filter)
        Gets the first Item that matches the given Filter
        Parameters:
        filter - Filter to match the item against
        Returns:
        Item that matches the filter or null
      • setUseBankHistoryCache

        public static void setUseBankHistoryCache​(boolean useCache)
        Set whether our methods use the Bank cache if you call a method while not in the bank
        Parameters:
        useCache - true (default) if you want to use the cache if available, false otherwise
      • all

        public static java.util.List<Item> all()
        Gets the items in your bank
        Returns:
        list of all unfiltered items in your bank - this includes null items
      • isLoaded

        public static boolean isLoaded()
        Checks to see if the Bank container has been loaded successfully at least once Check is done during all() call
        Returns:
        True if the bank container has been loaded successfully once
      • calculateSlotPosition

        public static java.awt.Rectangle calculateSlotPosition​(int slot)
        Gets the virtual position for the specified slot.
        Parameters:
        slot - The slot to find the position for.
        Returns:
        The rectangle object of the slot.
      • resetCache

        public static void resetCache()
        This will reset the bank history cache to it's initial state
      • isOpen

        public static boolean isOpen()
        Checks if the bank is currently open or not.
        Returns:
        True if bank interface is open, else False
      • getClosestBank

        public static Entity getClosestBank​(BankType type)
        Gets the nearest bank interactable based on BankType
        Parameters:
        type - bank type to look for
        Returns:
        entity of closest bank object, null if no recognized bank type
      • open

        public static boolean open()
        Finds the nearest BankType and attempts to open it. This method will walk to the nearest available BankLocation (getClosestBankLocation()) if there isn't a local bank entity.
        Returns:
        true if the bank opens successfully, otherwise false
      • open

        public static boolean open​(BankLocation bank)
        Opens a specific bank location, if you're not in the area it will call walk(Tile) and return false If given a null bank location, it will verify the nearest bank type's location (if we have it) If that verification fails, it will recalculate to find the nearest valid bank location.
        Parameters:
        bank - BankLocation that you want to open/go to, give null if you want it to just find the nearest loaded BankType
        Returns:
        True if opens successfully, else false
      • getClosestBankLocation

        public static BankLocation getClosestBankLocation()
        Get the closest bank location. Does not include teleports in this calculation
        Returns:
        the bank location closest to your player.
      • getClosestBankLocation

        public static BankLocation getClosestBankLocation​(boolean includeTeleports)
        Gets the nearest bank location see BankLocation.getNearest(Tile, boolean)
        Parameters:
        includeTeleports - whether to include use of teleports in inventory/equipment when calculating closest bank
        Returns:
        Closest bank location
      • withdraw

        public static boolean withdraw​(int id)
        Withdraws one of the given item id
        Parameters:
        id - The id of the item to withdraw.
        Returns:
        True if interaction was successful, else False
      • withdrawAll

        public static boolean withdrawAll​(int id)
        Withdraws all of an item for a given ID
        Parameters:
        id - The id of the item to withdraw.
        Returns:
        True if interaction was successful, else False
      • withdraw

        public static boolean withdraw​(int id,
                                       int amount)
        Withdraws an item for the id and amount given.
        Parameters:
        id - The id of the item to withdraw.
        amount - The amount to withdraw.
        Returns:
        True if interaction was successful, else False
      • withdraw

        public static boolean withdraw​(java.lang.String name)
        Withdraws one of an item with the given name
        Parameters:
        name - The name of the item to withdraw, case-insensitive.
        Returns:
        True if interaction was successful, else False
      • withdraw

        public static boolean withdraw​(java.lang.String name,
                                       int amount)
        Withdraws an item for the name and amount given.
        Parameters:
        name - The name of the item to withdraw, case-insensitive
        amount - The amount to withdraw.
        Returns:
        True if interaction was successful, else False
      • withdrawAll

        public static boolean withdrawAll​(java.lang.String name)
        Withdraws all of an item for the given name
        Parameters:
        name - The name of the item to withdraw, case-insensitive.
        Returns:
        True if interaction was successful, else False
      • withdraw

        public static boolean withdraw​(Filter<Item> filter)
        Withdraws one item that matches the given Filter
        Parameters:
        filter - The filter to match the item against
        Returns:
        True if interaction was successful, else False
      • withdrawAll

        public static boolean withdrawAll​(Filter<Item> filter)
        Withdraws all of an item that matches the given Filter
        Parameters:
        filter - The filter to match the item against
        Returns:
        True if interaction was successful, else False
      • withdraw

        public static boolean withdraw​(Filter<Item> filter,
                                       int amount)
        Withdraws an item that matches the given Filter for the given amount For withdraw All-but-one pass in value: -9411
        Parameters:
        filter - The filter to match the item against
        amount - The amount to withdraw.
        Returns:
        True if interaction was successful, else False
      • depositAllItems

        public static boolean depositAllItems()
        Deposits all items in your inventory with the deposit all button.
      • depositAllEquipment

        public static boolean depositAllEquipment()
        Deposits all worn equipment with the deposit all equipment button.
      • deposit

        public static boolean deposit​(Filter<Item> filter,
                                      int amount)
        Deposits the first item that matches the given Filter for the given amount
        Parameters:
        filter - The filter to match the item against
        amount - The amount of the item to deposit.
        Returns:
        True if deposit success, else False
      • depositAllExcept

        public static boolean depositAllExcept​(Filter<Item> filter)
        Deposits all items that do not match the given Filter Will call depositAllItems() if your inventory does not contain any of the given filter (nothing to exclude)
        Parameters:
        filter - Filter to exclude from the deposit all iterations
        Returns:
        True if all items that don't match the given filter are deposited
      • close

        public static boolean close()
        Exits the bank with the close button. If Esc Interface Closing is enabled, it will close with the ESC key See ClientSettings.isEscInterfaceClosingEnabled()
        Returns:
        True if bank is already closed, or if the bank is successfully closed, else false
      • getCurrentTab

        public static int getCurrentTab()
        Gets the current tab that is open
        Returns:
        Integer value of the current tab, -1 if one isn't open or found
      • slotBounds

        public static java.awt.Rectangle slotBounds​(int slot)
        Gets the bounds of a slot
        Parameters:
        slot - Slot to get bounds of
        Returns:
        Rectangle of the slot
      • openTab

        public static boolean openTab​(int tab)
        Opens the bank tab specified
        Parameters:
        tab - integer value of tab that you want opened
        Returns:
        whether tab was successfully opened.
      • openTab

        public static boolean openTab​(BankTab tab)
        Opens the BankTab specified.
        Parameters:
        tab - The BankTab to open.
        Returns:
        True if BankTab was opened, else false
      • getBankHistoryCache

        public static java.util.List<Item> getBankHistoryCache()
        Gets the bank item history cache. The history cache is updated periodically as bank methods are called like withdraw, deposit, all
        Returns:
        list of all your bank items since your last visit.
      • addToBankHistoryCache

        public static boolean addToBankHistoryCache​(Item item)
        This allows you to add an item to the bank history cache, it should only be necessary if you're doing things outside our API. If the cache already contains the given item, we'll add (or subtract if given an item with a negative amount) to the item's amount in cache.
        Parameters:
        item - the item to add to the cache
        Returns:
        true if a cache exists and we add the item to it, false otherwise
      • getLastBankHistoryCacheTime

        public static long getLastBankHistoryCacheTime()
        Returns the last timestamp (using System#currentTimeMillis) of a cache update
        Returns:
        timestamp of last cache update, or 0 if the bank cache hasn't been created yet
      • getLastBankHistoryCacheTick

        public static long getLastBankHistoryCacheTick()
        Returns the last game tick (using Client.getGameTick()) of a cache update
        Returns:
        game tick of last cache update, or 0 if the bank cache hasn't been created yet
      • isCached

        public static boolean isCached()
        Checks if the bank has been cached.
        Returns:
        true if we've cached the bank's items, false otherwise
      • getChild

        public static WidgetChild getChild​(int id)
        Gets the WidgetChild of the Item with the given ID
        Parameters:
        id - the id of the item
        Returns:
        WidgetChild of the item
      • getChild

        public static WidgetChild getChild​(java.lang.String name)
        Gets the WidgetChild of the Item with the given name
        Parameters:
        name - the name of the item
        Returns:
        WidgetChild of the item
      • getChild

        public static WidgetChild getChild​(Filter<Item> filter)
        Gets the WidgetChild of the Item that matches the given Filter
        Parameters:
        filter - the filter used to find item.
        Returns:
        WidgetChild of the item
      • getChild

        public static WidgetChild getChild​(Item item)
        Gets the WidgetChild of the Item based on the item's slot value
        Parameters:
        item - Item to get the child of
        Returns:
        WidgetChild of the item
      • getChildForSlot

        public static WidgetChild getChildForSlot​(int slot)
        Gets the WidgetChild for the given slot
        Parameters:
        slot - Bank slot to get the WidgetChild for.
        Returns:
        WidgetChild of the slot
      • getRearrangeMode

        public static BankMode getRearrangeMode()
        Gets the current rearrange mode type;
        Returns:
        current rearrange mode wrapped in a BankMode object.
      • isSlotVisible

        public static boolean isSlotVisible​(Item item)
        Determines if the given Item's slot is visible
        Parameters:
        item - The item that the slot you are searching for contains.
        Returns:
        True if slot is visible, else false
      • setWithdrawMode

        public static boolean setWithdrawMode​(BankMode mode)
        Sets the withdraw mode, either BankMode.ITEM or BankMode.NOTE
        Parameters:
        mode - BankMode to switch to
        Returns:
        True if successfully switched, else false
      • setRearrangeMode

        public static boolean setRearrangeMode​(BankMode mode)
        Sets the Rearrange mode for the bank either BankMode.SWAP or BankMode.INSERT
        Parameters:
        mode - BankMode
        Returns:
        true if successfully switched else false
      • getDefaultQuantity

        public static BankQuantitySelection getDefaultQuantity()
        Gets the currently selected default quantity for withdraw or deposit actions
      • placeHoldersEnabled

        public static boolean placeHoldersEnabled()
        Checks whether placeholders are currently enabled
      • togglePlaceholders

        public static boolean togglePlaceholders​(boolean enabled)
        Toggles whether placeholders are enabled or not
        Parameters:
        enabled - True/False
        Returns:
        True if placeholders successfully set to given boolean
      • needToScrollUp

        public static boolean needToScrollUp​(Item item)
        Determines if it needs to scroll up in order to see the given Item
        Parameters:
        item - The item that you're looking for
        Returns:
        True if it needs to scroll up, else false
      • needToScrollDown

        public static boolean needToScrollDown​(Item item)
        Determines if it needs to scroll down for the Item to be visible
        Parameters:
        item - The item you're looking for
        Returns:
        True if you need to scroll down, else false
      • needToScroll

        public static boolean needToScroll​(Item item)
        Determines if the bot needs to scroll to find the Item
        Parameters:
        item - The item that you're checking for
        Returns:
        True if the bank needs to scroll up or down for the item to be visible
      • getRow

        public static int getRow​(Item item)
        Gets the row of the Item
        Parameters:
        item - Item to find the row of
        Returns:
        Integer value of the row of the Item based on Item.getSlot()
      • getTab

        public static int getTab​(Item item)
        Gets the tab for the Item
        Parameters:
        item - Item to get the tab of, based on Item.getSlot()
        Returns:
        Integer value of the tab the item is in, 0 if not found
      • getTab

        public static int getTab​(int slot)
      • availableTabs

        public static int availableTabs()
        Gets the number of tabs currently available
        Returns:
        Integer value of the current amount of tabs available
      • count

        public static int count​(BankTab tab)
        Gets the Item count for the BankTab
        Returns:
        Integer value with how many items are in the tab
      • getCurrentBankTab

        public static BankTab getCurrentBankTab()
        Gets the current BankTab
        Returns:
        currently open BankTab, else null
      • getScrollHeight

        public static int getScrollHeight()
        Determines the current scroll position height of the bank's scroll container.
        Returns:
        The current scroll position height of the bank's scroll container.
      • scroll

        public static boolean scroll​(int id,
                                     BankScroll type)
        Scrolls to the item with the given ID using the BankScroll scroll type
        Parameters:
        id - the id of the item to scroll to.
        type - the method of scrolling you would like to use.
        Returns:
        true if the item is visible after scrolling.
      • scroll

        public static boolean scroll​(int id)
        Scrolls to the item with the given ID see scroll(int, BankScroll) with a random choice of scroll types
      • scroll

        public static boolean scroll​(java.lang.String name,
                                     BankScroll type)
        Scrolls to the item with the given name using the given BankScroll type
        Parameters:
        name - the name of the item to scroll to.
        type - the method of scrolling you would like to use.
        Returns:
        true if the item is visible after scrolling.
      • scroll

        public static boolean scroll​(Filter<Item> filter,
                                     BankScroll type)
        Scrolls to the item which matches the given filter using the given BankScroll type
        Parameters:
        filter - the filter of the item to scroll to.
        type - the method of scrolling you would prefer to use, however it will always use the scroll wheel if you have more than 300 items in your bank or if you're on resizable mode
        Returns:
        true if the item is visible after scrolling.
      • updateCache

        public static void updateCache​(java.util.Collection<Item> items)
        Clears the bank history cache and fills it with the given collection of items, only works if bank is open
        Parameters:
        items - collection of items to fill the bank cache with
      • updateCache

        public static void updateCache()
        Used for updating the bank cache, generally reserved for internal use but can be called in a script during custom banking This will clear the bank cache and update it with all bank items
      • depositAll

        public static boolean depositAll​(Filter<Item> filter)
      • deposit

        public static boolean deposit​(int id,
                                      int amount)
      • deposit

        public static boolean deposit​(java.lang.String name,
                                      int amount)
      • deposit

        public static boolean deposit​(Item item,
                                      int amount)
      • depositAllExcept

        public static boolean depositAllExcept​(java.lang.String... names)
      • depositAllExcept

        public static boolean depositAllExcept​(java.lang.Integer... ids)
      • depositAllExcept

        public static boolean depositAllExcept​(int[] ids)
      • deposit

        public static boolean deposit​(int id)
      • deposit

        public static boolean deposit​(java.lang.String name)
      • deposit

        public static boolean deposit​(Item item)
      • deposit

        public static boolean deposit​(Filter<Item> filter)
      • depositAll

        public static boolean depositAll​(int id)
      • depositAll

        public static boolean depositAll​(java.lang.String name)
      • depositAll

        public static boolean depositAll​(Item item)
      • fullSlotCount

        public static int fullSlotCount()
        Number of slots that contain non-null items Includes placeholders as a full slot
      • emptySlotCount

        public static int emptySlotCount()
        Number of slots that do not contain an item or placeholder
      • isSlotEmpty

        public static boolean isSlotEmpty​(int slot)
        Checks if the given slot contains an item
      • isSlotFull

        public static boolean isSlotFull​(int slot)
        Checks if the slot has an Item in it
      • onlyContains

        public static boolean onlyContains​(java.lang.String... names)
        Checks if your Bank only contains items with specified names
        Parameters:
        names - Names of items to look for
        Returns:
        True if Bank only contains items with the given names, else False
      • onlyContains

        public static boolean onlyContains​(java.lang.Integer... ids)
        Checks if your Bank only contains items with the specified IDs
        Parameters:
        ids - IDs of items to check for
        Returns:
        True if Bank only contains items with the specified IDs, else False
      • onlyContains

        public static boolean onlyContains​(Filter<Item> f)
        Checks if your Bank only contains items that match the Filter
        Parameters:
        f - Filter to pass items through
        Returns:
        True if Bank only contains items matching Filter, else False
      • slotContains

        public static boolean slotContains​(int slot,
                                           java.lang.String... names)
        Checks if the slot contains items that matches the given names.
        Parameters:
        names - names of the items to check
        Returns:
        true if Bank only contains items matching Filter, else false
      • slotNameContains

        public static boolean slotNameContains​(int slot,
                                               java.lang.String sub)
        Checks if the slot has an item whose name contains the given sub string
        Parameters:
        sub - the substring which will be used to search.
        Returns:
        True if Bank only contains items matching substring, else false.
      • slotContains

        public static boolean slotContains​(int slot,
                                           java.lang.Integer... ids)
        Checks if the slot contains an item with an ID matching one of the given ids
        Parameters:
        ids - ids of the items to check.
        Returns:
        True if Bank slot contains one of the given ids, else false
      • slotContains

        public static boolean slotContains​(int slot,
                                           Item t)
        Checks if the slot contains given Item
        Parameters:
        t - The item to check.
        Returns:
        True if Bank contains the given item in the given slot, else false
      • slotContains

        public static boolean slotContains​(int slot,
                                           Filter<Item> filter)
        Checks if the slot contains an item that matches the filter.
        Parameters:
        filter - Filter to pass items through.
        Returns:
        True if Bank only contains an item matching the given Filter, else false.
      • getFirstEmptySlot

        public static int getFirstEmptySlot()
        Gets the first empty slot in the bank.
        Returns:
        slot number, if bank is full -1.
      • getFirstFullSlot

        public static int getFirstFullSlot()
        Gets the next full slot in your bank
        Returns:
        slot number, if bank is empty -1
      • getIdForSlot

        public static int getIdForSlot​(int slot)
        Gets the ID of the Item in the slot.
        Parameters:
        slot - Slot to get item id of.
        Returns:
        Item ID or -1 if no item.
      • getNameForSlot

        public static java.lang.String getNameForSlot​(int slot)
        Gets the Name for the Item in the slot.
        Parameters:
        slot - Slot to get item name of.
        Returns:
        Item name or "" if item is null.
      • getSlot

        public static int getSlot​(int id)
        Gets the slot for the item with specified ID.
        Parameters:
        id - ID of item to get slot of.
        Returns:
        Item slot or -1 if Item is null.
      • slot

        @Deprecated
        public static int slot​(int id)
        Deprecated.
      • getSlot

        public static int getSlot​(java.lang.String name)
        Gets the slot for the item with specified name.
        Parameters:
        name - Name of item to get slot of.
        Returns:
        Item slot or -1 if Item is null.
      • slot

        @Deprecated
        public static int slot​(java.lang.String name)
        Deprecated.
      • getSlot

        public static int getSlot​(Filter<Item> filter)
        Gets the slot for the first item that matches the given filter
        Parameters:
        filter - filter of the item to get slot of.
        Returns:
        Item slot or -1 if no slots match the given filter.
      • all

        public static java.util.List<Item> all​(Filter<Item> filter)
        A list of all the non-null items that match the given filter Filters out null before checking against the filter
        Parameters:
        filter - the filter to search with.
        Returns:
        the list of all filtered items.
      • getItemInSlot

        public static Item getItemInSlot​(int slot)
        Gets item in specified slot.
        Parameters:
        slot - the slot.
        Returns:
        the item in slot.
      • get

        public static Item get​(int id)
        Gets the first item with the given id
        Parameters:
        id - ID of the item to get
        Returns:
        Item that matches the given ID, or null if not found
      • get

        public static Item get​(java.lang.Integer... ids)
        Gets the first Item that matches one of the given ids
        Parameters:
        ids - ids to check for
        Returns:
        First item found or null if none found
      • get

        public static Item get​(java.lang.String name)
        Get the item for specified name.
        Parameters:
        name - the name of the item.
        Returns:
        the item if list contains it, otherwise null.
      • get

        public static Item get​(java.lang.String... names)
        Gets the first item that matches one of the given names
        Parameters:
        names - Names of the items to look for
        Returns:
        The first item in the bank that matches one of the given names, else null if none found
      • except

        public static java.util.List<Item> except​(Filter<Item> filter)
        Get all items which do not fit the given criteria. Ignores placeholders
        Parameters:
        filter - The filter of the items to ignore.
        Returns:
        The list of items found which do not match the given criteria.
      • size

        @Deprecated
        public static int size()
        Deprecated.
      • isEmpty

        public static boolean isEmpty()
        Checks if the bank is empty (including placeholders)
      • contains

        public static boolean contains​(int id)
        Checks if the bank contains the given ID Placeholders are ignored
        Parameters:
        id - the id
        Returns:
        true if contains, else false.
      • contains

        public static boolean contains​(java.lang.String string)
        Determines if bank contains an item that matches the given name. Placeholders are ignored
        Parameters:
        string - the name of the item.
        Returns:
        true if bank contains item, otherwise false.
      • containsAll

        public static boolean containsAll​(java.lang.String... names)
        Checks if your Bank contains all of the items with names specified Placeholders are ignored
        Parameters:
        names - Names of items to check for
        Returns:
        True if Bank contains all names, else False
      • containsAll

        public static boolean containsAll​(java.lang.Integer... ids)
        Checks if your Bank contains all of the items with specified IDs Placeholders are ignored
        Parameters:
        ids - IDs of items to check for
        Returns:
        True if Bank contains all IDs, else false.
      • containsAll

        public static boolean containsAll​(java.util.Collection<?> collection)
        Checks if your bank contains all of the items in the collection
        Parameters:
        collection - The collection of items to compare against
        Returns:
        True if bank contains all of the items, else false.
      • contains

        public static boolean contains​(java.lang.Integer... ids)
        Checks if your collection contains at least one item which meets one of the specified ids. Placeholders are ignored
        Parameters:
        ids - Item IDs to check for
        Returns:
        True if contains one of, else false
      • contains

        public static boolean contains​(java.lang.String... names)
        Checks if your collection contains at least one item which meets one of the specified names. Placeholders are ignored
        Parameters:
        names - names to check for
        Returns:
        true if contains one of, else false.
      • contains

        public static boolean contains​(Filter<Item> filter)
        Checks if your collection contains at least one item which meets the specified filter. Placeholders are ignored
        Parameters:
        filter - the filter to search with.
        Returns:
        true if contains one of, else false.
      • contains

        public static boolean contains​(java.lang.Object o)
        Checks to see if the bank contains an item matching the given Object Placeholders are ignored
        Parameters:
        o - Object to check for, could be Integer, String, Filter, or a given Item, all abstracted to 'Object'
        Returns:
        True if corresponding contains returns true, false if doesn't contain or cannot find a corresponding contains to call
      • isFull

        public static boolean isFull()
        Determines if bank is full.
        Returns:
        true if full, else false
      • count

        public static int count​(java.lang.String name)
        Count of all the items that match the search. Placeholders are ignored
        Parameters:
        name - the name of the item.
        Returns:
        the total count of matching items.
      • count

        public static int count​(int id)
        Count of all the items that match the search. Placeholders are ignored
        Parameters:
        id - the id of them item.
        Returns:
        the total count of matching items.
      • count

        public static int count​(java.lang.String... names)
        Count of all the items that match the search. Placeholders are ignored
        Parameters:
        names - the names of the item.
        Returns:
        the total count of matching items.
      • count

        public static int count​(java.lang.Integer... ids)
        Count of all the items that match the search. Placeholders are ignored
        Parameters:
        ids - the ids of them item.
        Returns:
        the total count of matching items.
      • count

        public static int count​(Filter<Item> filter)
        Count of all the items that match the search. Placeholders are ignored
        Parameters:
        filter - the filter to count with
        Returns:
        the total count of matching items.
      • set

        public static Item set​(int index,
                               Item element)
        Sets an Item to the given slot Used internally, shouldn't really be touched by API users
      • drag

        public static boolean drag​(int fromSlot,
                                   int toSlot)
        Drags the item from one slot to another, either of which can be empty to simply move an item from one slot to the other
        Parameters:
        fromSlot - the first item's slot
        toSlot - the second item's slot
        Returns:
        true if the items are dragged successfully or if both slots are the same, false otherwise
      • getCustomWithdrawAmount

        public static int getCustomWithdrawAmount()
      • isAlwaysOpenTab

        public static boolean isAlwaysOpenTab()
      • setAlwaysOpenTab

        public static void setAlwaysOpenTab​(boolean alwaysOpenTab)