Class Bank

java.lang.Object
dev.twilite.game.facade.Bank

public class Bank extends Object
Bank accessors backed by the client's inventory data and interface components.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Closes the bank interface
    static boolean
    contains(int... ids)
    Checks if the bank contains any of the specified items.
    static boolean
    containsAll(int... ids)
    Checks if the bank contains all of the specified items.
    static int
    count(int... ids)
    Returns the total stack size of an item in the inventory.
    static void
    deposit(Function<ItemView,Optional<Item>> query, int amount)
    Deposits an item selected from the bank-side inventory view.
    static void
    Deposits all matching bank-side inventory items, once per item id.
    static void
    Deposits supported carried containers, such as the looting bag, with the bank deposit-containers button.
    static void
    Deposits the full bank-side inventory with the bank deposit-inventory button.
    static void
    Deposits all worn equipment with the bank deposit-equipment button.
    static ItemView
    Returns a lazy view over items in the inventory (Bankside).
    static ItemView
    Returns a lazy view over items in the bank.
    static void
    Walks to and opens the nearest withdrawable bank.
    static void
    open(BankLocation location)
    Walks to and opens a specific bank location.
    static void
    open(BankLocation location, boolean force)
    Opens a specific bank location.
    static boolean
    Returns whether the Bank interface is currently visible.
    static void
    withdraw(Function<ItemView,Optional<Item>> query, int amount)
    Withdraws an item selected from the bank item view.
    static void
    withdraw(Function<ItemView,Optional<Item>> query, int amount, boolean noted)
    Withdraws an item selected from the bank item view using the requested note mode.
    static boolean
    Returns whether the bank is currently set to withdraw noted items.
    static void
    withdrawNote(boolean noted)
    Sets whether bank withdrawals should produce noted items.
    static int
    x()
    Returns the current X amount value

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Bank

      public Bank()
  • Method Details

    • items

      public static ItemView items()
      Returns a lazy view over items in the bank.
    • inventory

      public static ItemView inventory()
      Returns a lazy view over items in the inventory (Bankside).
    • close

      public static void close()
      Closes the bank interface
    • showing

      public static boolean showing()
      Returns whether the Bank interface is currently visible.
    • count

      public static int count(int... ids)
      Returns the total stack size of an item in the inventory.
      Parameters:
      ids - item ids, usually from ItemId
    • open

      public static void open()
      Walks to and opens the nearest withdrawable bank.
    • open

      public static void open(BankLocation location)
      Walks to and opens a specific bank location.
    • open

      public static void open(BankLocation location, boolean force)
      Opens a specific bank location.

      When force is true, the method walks toward the configured bank coordinate before falling back to nearby loaded bank entities. This avoids clicking a different local bank while a route-selected target is still far away.

      Parameters:
      location - bank location to use
      force - whether to force movement toward location while it is distant
    • contains

      public static boolean contains(int... ids)
      Checks if the bank contains any of the specified items.
      Parameters:
      ids - item ids to check, usually from ItemId
      Returns:
      true if at least one of the specified items is in the bank, otherwise false
    • containsAll

      public static boolean containsAll(int... ids)
      Checks if the bank contains all of the specified items.
      Parameters:
      ids - item ids to check, usually from ItemId
      Returns:
      true if all of the specified items are in the bank, otherwise false
    • x

      public static int x()
      Returns the current X amount value
    • withdrawNote

      public static boolean withdrawNote()
      Returns whether the bank is currently set to withdraw noted items.
    • withdrawNote

      public static void withdrawNote(boolean noted)
      Sets whether bank withdrawals should produce noted items.
    • deposit

      public static void deposit(Function<ItemView,Optional<Item>> query, int amount)
      Deposits an item selected from the bank-side inventory view. The query is applied to inventory(), and amounts below 1 are treated as 1.
    • depositAll

      public static void depositAll(Function<ItemView,ItemView> query)
      Deposits all matching bank-side inventory items, once per item id. The query is applied to inventory().
    • withdraw

      public static void withdraw(Function<ItemView,Optional<Item>> query, int amount)
      Withdraws an item selected from the bank item view. The query is applied to items(), and amounts below 1 are treated as 1.
    • withdraw

      public static void withdraw(Function<ItemView,Optional<Item>> query, int amount, boolean noted)
      Withdraws an item selected from the bank item view using the requested note mode. The query is applied to items(), and amounts below 1 are treated as 1.
    • depositInventory

      public static void depositInventory()
      Deposits the full bank-side inventory with the bank deposit-inventory button.
    • depositWorn

      public static void depositWorn()
      Deposits all worn equipment with the bank deposit-equipment button.
    • depositContainers

      public static void depositContainers()
      Deposits supported carried containers, such as the looting bag, with the bank deposit-containers button.