isOpen
isOpen: (Bank) -> booleanWhether the bank interface is open. A pure read.
Bank open, deposit and withdraw, the PIN, and loadouts.
bank| Method | Returns | Description |
|---|---|---|
isOpen() | boolean | Whether the bank interface is open. A pure read. |
isNearBank() | boolean | Whether the bank is open, or a bank booth, chest or banker is in range. |
cached() | RememberedItems? | The bank as this account last saw it, kept across relogs and restarts. |
seedVault() | RememberedItems? | The seed vault as this account last saw it, kept across relogs and restarts. |
onPinScreen() | boolean | Whether the bank PIN keypad is open. A read only: no call types a PIN, so a plugin stops here and hands back to the player. |
enablePinKeyboard() | () | Lets the number keys the player types press the bank PIN keypad's digits, with no click and no mouse movement. It lasts one opening of the… |
withdrawNotesEnabled() | boolean | Whether the bank's Note withdrawal mode is on. |
nearestBanker() | NPC? | The nearest banker NPC exposing Bank. |
depositBox() | DepositBox | The deposit box interface. |
search() | ContainerQuery | A query over the bank's contents, live or last-known. An unseen bank reads as empty: cached() ~= nil tells the two apart. |
item(number) | ItemHandle? | The first bank slot holding an item. |
deposit(number, number | "all") | boolean | Deposit from the inventory. |
withdraw(number, number | "all") | boolean | Withdraw from the bank. |
depositInventory() | boolean | Press the bank's Deposit inventory button. |
depositEquipment() | boolean | Press the bank's Deposit worn items button. |
depositLootingBag() | boolean | Click Deposit on the looting bag in the inventory. |
depositContainers() | boolean | Press the bank's Deposit loot bags and other containers button. |
setWithdrawNotes(boolean) | boolean | Turn Note withdrawal mode on or off. The bank's button flips the mode, so this presses it only when the mode differs. |
togglePlaceholders() | boolean | Toggle placeholders. |
click(string, string) | boolean | Use one named option on one bank item, the route to an option withdraw has no amount for ("Withdraw-All-but-1"). |
open(string?) | boolean | Open the nearest bank. |
close() | boolean | Close the bank with its frame's close button. |
newLoadout(EquipmentGoal, InventoryGoal) | Loadout | A bank trip towards a goal: open the bank, deposit what the goal does not want, withdraw and equip what it does. The goal is fixed here, an… |
isOpenisOpen: (Bank) -> booleanWhether the bank interface is open. A pure read.
isNearBankisNearBank: (Bank) -> booleanWhether the bank is open, or a bank booth, chest or banker is in range.
cachedcached: (Bank) -> RememberedItems?The bank as this account last saw it, kept across relogs and restarts.
nil until this account's bank has been opened with Bento running: an unseen bank and an empty one are different answers. live while the bank is open. The rows are read-only: to act on an item, withdraw or click with the bank open.
seedVaultseedVault: (Bank) -> RememberedItems?The seed vault as this account last saw it, kept across relogs and restarts.
nil until the seed vault has been opened with Bento running. live while it is open.
onPinScreenonPinScreen: (Bank) -> booleanWhether the bank PIN keypad is open. A read only: no call types a PIN, so a plugin stops here and hands back to the player.
enablePinKeyboardenablePinKeyboard: (Bank) -> ()Lets the number keys the player types press the bank PIN keypad's digits, with no click and no mouse movement. It lasts one opening of the keypad: call it each time the keypad is set up (the bankpinButtonSetup script callback). The player types the PIN; no call types one.
withdrawNotesEnabledwithdrawNotesEnabled: (Bank) -> booleanWhether the bank's Note withdrawal mode is on.
nearestBankernearestBanker: (Bank) -> NPC?The nearest banker NPC exposing Bank.
nil when none is reachable.depositBoxdepositBox: (Bank) -> DepositBoxThe deposit box interface.
searchsearch: (Bank) -> ContainerQueryA query over the bank's contents, live or last-known. An unseen bank reads as empty: cached() ~= nil tells the two apart.
itemitem: (Bank, number) -> ItemHandle?The first bank slot holding an item.
bank:item(id) ~= nil says whether the bank holds it, and its quantity() how many. Read from the bank container, which is remembered after the bank closes.
itemIdnil when the bank does not hold it.depositdeposit: (Bank, number, number | "all") -> booleanDeposit from the inventory.
bank:deposit(id, "all") deposits every one; it takes any amount. A repeat of the same call is not throttled.
itemIdamount"all".false when the bank is shut or the inventory does not hold it.withdrawwithdraw: (Bank, number, number | "all") -> booleanWithdraw from the bank.
bank:withdraw(id, "all") and bank:withdraw(id, n). Withdraw-X opens the amount prompt; ui:dialogue():typeAmount(n) answers it.
itemIdamount"all".false when the bank is shut or does not hold it.depositInventorydepositInventory: (Bank) -> booleanPress the bank's Deposit inventory button.
false when the bank is shut.depositEquipmentdepositEquipment: (Bank) -> booleanPress the bank's Deposit worn items button.
false when the bank is shut.depositLootingBagdepositLootingBag: (Bank) -> booleanClick Deposit on the looting bag in the inventory.
false when the bank is closed or the inventory holds no looting bag.depositContainersdepositContainers: (Bank) -> booleanPress the bank's Deposit loot bags and other containers button.
false when the bank is shut.setWithdrawNotessetWithdrawNotes: (Bank, boolean) -> booleanTurn Note withdrawal mode on or off. The bank's button flips the mode, so this presses it only when the mode differs.
ontrue when it already is, or the click was queued; false when it differs and the bank is shut.togglePlaceholderstogglePlaceholders: (Bank) -> booleanToggle placeholders.
false when the bank is shut.clickclick: (Bank, string, string) -> booleanUse one named option on one bank item, the route to an option withdraw has no amount for ("Withdraw-All-but-1").
iteminventory:containsName.option"Withdraw-All".false when the bank is shut, no item matches, or it has no such option.openopen: (Bank, string?) -> booleanOpen the nearest bank.
Already open is success. Returns false when no bank target is in range (logged once per run of misses). One search a tick per client: a second call in the tick reuses the first's result, so a miss costs nothing the second time.
The nearest banker or bank object by path. It does not answer the PIN-settings warning, and it banks on an ultimate ironman.
targetcloseclose: (Bank) -> booleanClose the bank with its frame's close button.
The button is Bankmain.FRAME op 1 on child 11. Not Escape (ui:pressKey(KeyEvent.VK_ESCAPE)), which closes the bank only while the game's Escape-closes-interfaces setting is on.
false when the bank is not open.newLoadoutnewLoadout: (Bank, EquipmentGoal, InventoryGoal) -> LoadoutA bank trip towards a goal: open the bank, deposit what the goal does not want, withdraw and equip what it does. The goal is fixed here, and a malformed goal raises here, so a typo cannot leave an item out of a goal and deposit it. It reads no game state, so make it once, when the plugin loads or starts, and keep it: its run advances one step a tick.
local trip = bank:newLoadout("4151:1,1704:1", { { itemId = ItemID.SHARK, quantity = 10 } })
function plugin:onGameTick()
local status, reason = trip:run()
if status == "done" then
-- worn and carried: move on
elseif status == "blocked" then
log:warn(reason) -- it will not get there by itself: fetch what it lacks, or stop
end
-- "running": it acted, or is waiting for its last click to land
endequipmentinventory