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.
for stack in bank() { if stack.id == 151 { stop } }
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() -> 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.
for stack in bank() { if stack.id == 151 { stop } }
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.
| Parameter | Type | What it does |
|---|---|---|
| idrequired | int | the item id |
| namerequired | string | the item name |
if bankAmount(151) < 26 { stop }
if bankAmount("Coal") < 26 { stop }
bankAvailable() -> bool
Whether the bank hooks are published. bankIsOpen() answers a confident false when they are not, which looks exactly like a closed bank.
if not bankAvailable() { stop }
bankCapacity() -> int
How many stacks the bank can hold, or 0 when the client does not publish it.
if bankCount() >= bankCapacity() { stop }
bankClose() -> bool
Shuts the bank and waits for the window to go. Not a passthrough - see bankWithdraw.
bankClose()
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.
| Parameter | Type | What it does |
|---|---|---|
| idrequired | int | the item id |
| namerequired | string | the item name |
if bankContains(151) { stop }
if bankContains("Coal") { stop }
bankCount() -> int
How many distinct stacks are banked. 0 while the bank is closed.
if bankCount() == 0 { return 600 }
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.
| Parameter | Type | What it does |
|---|---|---|
| idrequired | int | the item id |
| amountrequired | int | how many to put in |
| namerequired | string | the item name |
if not bankDeposit(151, 10) { return 1000 }
if not bankDeposit("Coal", 10) { return 1000 }
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.
| Parameter | Type | What it does |
|---|---|---|
| idrequired | int | the item id |
| namerequired | string | the item name |
if not bankDepositAll(151) { return 1000 }
if not bankDepositAll("Coal") { return 1000 }
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.
bankDepositCape()
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.
if not bankDepositEverything() { return 1000 }
bankIsOpen() -> bool
True while the bank window is up. Nothing else in this group does anything while it is false.
if not bankIsOpen() { return 600 }
bankItem(id: int) -> bankitem?bankItem(name: string) -> bankitem?
The banked stack of this item, or none.
The banked stack with this name, or none.
| Parameter | Type | What it does |
|---|---|---|
| idrequired | int | the item id |
| namerequired | string | the item name |
let ore = bankItem(151)
let coal = bankItem("Coal")
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.
let absent = bankMissing()
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.
| Parameter | Type | What it does |
|---|---|---|
| idrequired | int | the item id |
| amountrequired | int | how many to take |
| namerequired | string | the item name |
if not bankWithdraw(151, 10) { return 1000 }
if not bankWithdraw("Coal", 10) { return 1000 }
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.
| Parameter | Type | What it does |
|---|---|---|
| idrequired | int | the item id |
| namerequired | string | the item name |
bankWithdrawAll(151)
bankWithdrawAll("Coal")