Class BankService


  • @Singleton
    public class BankService
    extends java.lang.Object
    A service class for interacting with global bank operations. This class handles operations on the bank interface like: opening, closing, depositing all items, and depositing all equipment.

    For depositing or withdrawing specific items use BankInventoryQuery and BankQuery respectively.

    • Constructor Summary

      Constructors 
      Constructor Description
      BankService()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean close()
      Closes the bank interface if it is open.
      boolean depositAll()
      Deposit all items in the players inventory into the bank.
      boolean depositAllEquipment()
      Deposits all worn items from the players equipment tab into the bank.
      boolean depositContainers()
      Deposits items in stored containers (like wilderness loot bags, rune pouches, etc...) into the bank.
      boolean enterPin​(int[] pin)
      Enters the bank pin using the provided 4 digits.
      int getXAmount()
      Returns the current amount the X variable is set to.
      boolean isClosed()
      Determines whether the bank interface is closed.
      boolean isOpen()
      Checks whether the bank interface is open.
      boolean isPinOpen()
      Returns true when the bank PIN interface is open and false otherwise.
      void onScriptCallbackEvent​(net.runelite.api.events.ScriptCallbackEvent event)  
      boolean setWithdrawMode​(boolean noted)
      Sets the withdrawal mode as either a note or item.
      void setXAmount​(int amount)
      Sets the X number of items to withdraw or deposit.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BankService

        public BankService()
    • Method Detail

      • isOpen

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

        public boolean isClosed()
        Determines whether the bank interface is closed.

        This method provides the inverse of the isOpen method by checking whether the bank interface is not open.

        Returns:
        true if the bank interface is closed, false otherwise.
      • isPinOpen

        public boolean isPinOpen()
        Returns true when the bank PIN interface is open and false otherwise.
        Returns:
        True for an open bank pin interface
      • onScriptCallbackEvent

        @Subscribe
        public void onScriptCallbackEvent​(net.runelite.api.events.ScriptCallbackEvent event)
      • enterPin

        public boolean enterPin​(int[] pin)
        Enters the bank pin using the provided 4 digits.
        Parameters:
        pin - An integer array of size 4 which contains the bank pin to enter.
        Returns:
        boolean true if the pin was entered and false otherwise. This will return true if the pin was entered at all. This doesn't necessarily mean the pin was correct.
      • setWithdrawMode

        public boolean setWithdrawMode​(boolean noted)
        Sets the withdrawal mode as either a note or item. If the withdrawal mode already matches the provided parameter no action will be taken.
        Parameters:
        noted - The boolean representing which withdraw mode to set. When set to false items will be withdrawn while true will withdraw items in a noted format.
        Returns:
        True if the withdrawal mode was set correctly and false otherwise.
      • setXAmount

        public void setXAmount​(int amount)
        Sets the X number of items to withdraw or deposit. The X variable can be set to any arbitrary integer value to withdraw or deposit X amount of a given item.
        Parameters:
        amount - The number of items to withdraw or deposit
      • getXAmount

        public int getXAmount()
        Returns the current amount the X variable is set to. The X variable can be set to any arbitrary integer value to withdraw or deposit X amount of a given item.
        Returns:
        The current X amount
      • close

        public boolean close()
        Closes the bank interface if it is open.
        Returns:
        True if the bank interface was closed successfully and false otherwise
      • depositAll

        public boolean depositAll()
        Deposit all items in the players inventory into the bank.
        Returns:
        True if the deposit was successful and false otherwise
      • depositAllEquipment

        public boolean depositAllEquipment()
        Deposits all worn items from the players equipment tab into the bank.
        Returns:
        True if the deposit was successful and false otherwise
      • depositContainers

        public boolean depositContainers()
        Deposits items in stored containers (like wilderness loot bags, rune pouches, etc...) into the bank.
        Returns:
        True if the deposit was successful and false otherwise