Package rsb.methods

Class Bank


public class Bank extends MethodProvider
  • Field Details

    • BANKERS

      public static int[] BANKERS
    • BANK_DEPOSIT_BOX

      public static int[] BANK_DEPOSIT_BOX
    • BANK_CHESTS

      public static int[] BANK_CHESTS
    • BANK_BOOTHS

      public static int[] BANK_BOOTHS
    • UNREACHABLE_BANKERS

      public static Point[] UNREACHABLE_BANKERS
  • Method Details

    • assignConstants

      public void assignConstants()
      Assigns the ID constants for all the banking objects in RuneScape
    • close

      public boolean close()
      Closes the bank interface. Supports deposit boxes.
      Returns:
      true if the bank interface is no longer open.
    • getAvailableBankSpace

      public int getAvailableBankSpace()
    • deposit

      public boolean deposit(int itemID, int number)
      If bank is open, deposits specified amount of an item into the bank. Supports deposit boxes.
      Parameters:
      itemID - The ID of the item.
      number - The amount to deposit. 0 deposits All. 1,5,10 deposit corresponding amount while other numbers deposit X.
      Returns:
      true if successful; otherwise false.
    • depositAll

      public boolean depositAll()
      Deposits all items in methods.inventory. Supports deposit boxes.
      Returns:
      true on success.
    • depositAllExcept

      public boolean depositAllExcept(int... items)
      Deposits all items in inventory except for the given IDs. Supports deposit boxes.
      Parameters:
      items - The items not to deposit.
      Returns:
      true on success.
    • depositAllEquipped

      public boolean depositAllEquipped()
      Deposit everything your player has equipped. Supports deposit boxes.
      Returns:
      true on success.
      Since:
      6 March 2009.
    • getCount

      public int getCount(int... items)
      Returns the sum of the count of the given items in the bank.
      Parameters:
      items - The array of items.
      Returns:
      The sum of the stacks of the items.
    • getCurrentTab

      public int getCurrentTab()
      Get current tab open in the bank.
      Returns:
      int of tab (0-8), or -1 if none are selected (bank is not open).
    • getTab

      public RSWidget getTab(int index)
      Gets a tab
      Parameters:
      index - Gets the bank tab at the specified index
      Returns:
      The bank tab
    • getBoxInterface

      public RSWidget getBoxInterface()
      Gets the deposit box interface.
      Returns:
      The deposit box RSWidget.
    • getItemAt

      public RSItem getItemAt(int index)
      Gets the RSWidget of the given item at the specified index.
      Parameters:
      index - The index of the item.
      Returns:
      RSWidget if item is found at index; otherwise null.
    • getInterface

      public RSWidget getInterface()
      Gets the bank interface.
      Returns:
      The bank RSWidget.
    • getItem

      public RSItem getItem(int id)
      Gets the first item with the provided ID in the bank.
      Parameters:
      id - ID of the item to get.
      Returns:
      The component of the item; otherwise null.
    • getItemPoint

      public Point getItemPoint(int slot)
      Gets the point on the screen for a given item. Numbered left to right then top to bottom.
      Parameters:
      slot - The index of the item.
      Returns:
      The point of the item or new Point(-1, -1) if null.
    • getItems

      public RSItem[] getItems()
      Gets all the items in the bank's inventory.
      Returns:
      an RSItem array of the bank's inventory interface.
    • isOpen

      public boolean isOpen()
      Checks whether the bank is open.
      Returns:
      true if the bank interface is open; otherwise false.
    • isDepositOpen

      public boolean isDepositOpen()
      Checks whether the deposit box is open.
      Returns:
      true if the deposit box interface is open; otherwise false.
    • getNearest

      public Object getNearest()
    • open

      public boolean open()
      Opens one of the supported banker NPCs, booths, or chests nearby. If they are not nearby, and they are not null, it will automatically walk to the closest one.
      Returns:
      true if the bank was opened; otherwise false.
    • openDepositBox

      public boolean openDepositBox()
      Opens one of the supported deposit boxes nearby. If they are not nearby, and they are not null, it will automatically walk to the closest one.
      Returns:
      true if the deposit box was opened; otherwise false.
    • openTab

      public boolean openTab(int tabNumber)
      Opens the bank tab.
      Parameters:
      tabNumber - The tab number - e.g. view all is 1.
      Returns:
      true on success.
    • isSearchOpen

      public boolean isSearchOpen()
      Returns:
      true if currently searching the bank.
    • searchItem

      public boolean searchItem(String itemName)
      Searches for an item in the bank. Returns true if succeeded (does not necessarily mean it was found).
      Parameters:
      itemName - The item name to find.
      Returns:
      true on success.
    • setRearrangeModeToInsert

      public boolean setRearrangeModeToInsert()
      Sets the bank rearrange mode to insert.
      Returns:
      true on success.
    • setRearrangeModeToSwap

      public boolean setRearrangeModeToSwap()
      Sets the bank rearrange mode to swap.
      Returns:
      true on success.
    • setWithdrawModeToItem

      public boolean setWithdrawModeToItem()
      Sets the bank withdraw mode to item.
      Returns:
      true on success.
    • setWithdrawModeToNote

      public boolean setWithdrawModeToNote()
      Sets the bank withdraw mode to note.
      Returns:
      true on success.
    • withdraw

      public boolean withdraw(int itemID, int count)
      Tries to withdraw an item. 0 is All. 1,5,10 use Withdraw 1,5,10 while other numbers Withdraw X.
      Parameters:
      itemID - The ID of the item.
      count - The number to withdraw.
      Returns:
      true on success.
    • getBoxCount

      public int getBoxCount(int... ids)
      Gets the count of all the items in the inventory with the any of the specified IDs while deposit box is open.
      Parameters:
      ids - the item IDs to include
      Returns:
      The count.
    • getBoxCount

      public int getBoxCount()
      Gets the count of all items in your inventory ignoring stack sizes while deposit box is open.
      Returns:
      The count.
    • getEquipmentItems

      public RSItem[] getEquipmentItems()
      Gets the equipment items from the bank interface.
      Returns:
      All equipment items that are being worn.
    • getEquipmentItem

      public RSItem getEquipmentItem(int id)
      Gets a equipment item from the bank interface.
      Parameters:
      id - ID of the item.
      Returns:
      RSItem
    • getEquipmentItemID

      public int getEquipmentItemID(String name)
      Gets the ID of a equipment item based on name.
      Parameters:
      name - Name of the item.
      Returns:
      -1 if item is not found.
    • getItemID

      public int getItemID(String name)
      Gets the item ID of a item side the bank.
      Parameters:
      name - Name of the item.
      Returns:
      -1 if item is not found.