Docs · bank

bank

16 bank commands, generated from the engine's own registry — signatures, parameters and a worked example each. A does something command acts on the game; a needs x() one answers a confident wrong answer when its client hooks are missing.

bank returns list<bankitem>
bank() -> list<bankitem>

Every stack in the bank, in bank order. Empty while the bank is closed, which is not the same as an empty bank - the client clears its own list on close.

Example
for stack in bank() { if stack.id == 151 { stop } }
bankAmount returns int
bankAmount(id: int) -> intbankAmount(name: string) -> int

How many of an item are banked, 0 if none.

How many of an item are banked by name, 0 if none.

ParameterTypeWhat it does
idrequired int the item id
namerequired string the item name
Example
if bankAmount(151) < 26 { stop }
if bankAmount("Coal") < 26 { stop }
bankAvailable returns bool
bankAvailable() -> bool

Whether the bank hooks are published. bankIsOpen() answers a confident false when they are not, which looks exactly like a closed bank.

Example
if not bankAvailable() { stop }
bankCapacity returns int
bankCapacity() -> int

How many stacks the bank can hold, or 0 when the client does not publish it.

Example
if bankCount() >= bankCapacity() { stop }
bankClose does something returns bool
bankClose() -> bool

Shuts the bank and waits for the window to go. Not a passthrough - see bankWithdraw.

Example
bankClose()
bankContains returns bool
bankContains(id: int) -> boolbankContains(name: string) -> bool

True when the bank holds any of this item.

True when the bank holds any item with this name.

ParameterTypeWhat it does
idrequired int the item id
namerequired string the item name
Example
if bankContains(151) { stop }
if bankContains("Coal") { stop }
bankCount returns int
bankCount() -> int

How many distinct stacks are banked. 0 while the bank is closed.

Example
if bankCount() == 0 { return 600 }
bankDeposit does something returns bool
bankDeposit(id: int, amount: int) -> boolbankDeposit(name: string, amount: int) -> bool

Puts items in and waits for them to leave the bag. Not a passthrough - see bankWithdraw. The amount is clamped to what is carried.

Puts items in by name and waits for them to leave the bag.

ParameterTypeWhat it does
idrequired int the item id
amountrequired int how many to put in
namerequired string the item name
Example
if not bankDeposit(151, 10) { return 1000 }
if not bankDeposit("Coal", 10) { return 1000 }
bankDepositAll does something returns bool
bankDepositAll(id: int) -> boolbankDepositAll(name: string) -> bool

Banks every one of this item you are carrying and waits for the bag to lose them. Not a passthrough - see bankWithdraw.

Banks every one of this item by name and waits for the bag to lose them.

ParameterTypeWhat it does
idrequired int the item id
namerequired string the item name
Example
if not bankDepositAll(151) { return 1000 }
if not bankDepositAll("Coal") { return 1000 }
bankDepositCape does something returns bool
bankDepositCape() -> bool

Empties the equipped skill/max cape's item store into the bank and waits for the bank to gain them. An RSCRevolution extra - only does anything while such a cape (2133, 2140, 2141, 2144) is worn. Not a passthrough - see bankWithdraw.

Example
bankDepositCape()
bankDepositEverything does something returns bool
bankDepositEverything() -> bool

Banks the whole bag - one packet per kind of item, not one per slot - and waits for the bag to empty. False when something would not go in, which is what a full bank looks like.

Example
if not bankDepositEverything() { return 1000 }
bankIsOpen needs bankAvailable() returns bool
bankIsOpen() -> bool

True while the bank window is up. Nothing else in this group does anything while it is false.

Example
if not bankIsOpen() { return 600 }
bankItem returns bankitem?
bankItem(id: int) -> bankitem?bankItem(name: string) -> bankitem?

The banked stack of this item, or none.

The banked stack with this name, or none.

ParameterTypeWhat it does
idrequired int the item id
namerequired string the item name
Example
let ore = bankItem(151)
let coal = bankItem("Coal")
bankMissing returns string
bankMissing() -> string

Which bank hooks are unbound, as one line, or an empty string when they all are. Worth printing once rather than guessing why nothing works.

Example
let absent = bankMissing()
bankWithdraw does something returns bool
bankWithdraw(id: int, amount: int) -> boolbankWithdraw(name: string, amount: int) -> bool

Takes items out and waits for them to appear in the bag. Not a passthrough: the API sends the packet and returns at once. The amount is clamped to what is banked, as the client's own withdraw clamps it.

Takes items out by name and waits for them to appear in the bag.

ParameterTypeWhat it does
idrequired int the item id
amountrequired int how many to take
namerequired string the item name
Example
if not bankWithdraw(151, 10) { return 1000 }
if not bankWithdraw("Coal", 10) { return 1000 }
bankWithdrawAll does something returns bool
bankWithdrawAll(id: int) -> boolbankWithdrawAll(name: string) -> bool

Takes out every one of this item and waits for them to appear in the bag.

Takes out every one of this item by name and waits for them to appear.

ParameterTypeWhat it does
idrequired int the item id
namerequired string the item name
Example
bankWithdrawAll(151)
bankWithdrawAll("Coal")