Docs · pouch

pouch

13 pouch 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.

pouch returns list<pouchitem>
pouch() -> list<pouchitem>

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

Example
for stack in pouch() { print(stack.name) }
pouchAmount returns int
pouchAmount(id: int) -> intpouchAmount(name: string) -> int

How many of an item are in the pouch, 0 if none.

How many of an item are in the pouch by name, 0 if none.

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

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

Example
if not pouchAvailable() { stop }
pouchContains returns bool
pouchContains(id: int) -> boolpouchContains(name: string) -> bool

True when the pouch holds any of this item.

True when the pouch holds any item with this name.

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

How many distinct stacks are in the pouch. 0 while it is closed.

Example
if pouchCount() == 0 { return 600 }
pouchDeposit does something returns bool
pouchDeposit(id: int, amount: int) -> boolpouchDeposit(name: string, amount: int) -> bool

Puts carried items into the pouch and waits for the bag to lose them. The item has to be in the bag: the client's deposit reads it out of the inventory slot it is in.

Puts carried items into the pouch by name and waits for the bag to lose them.

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

Puts every carried one of this item into the pouch and waits.

ParameterTypeWhat it does
idrequired int the item id
Example
pouchDepositAll(151)
pouchExists returns bool
pouchExists() -> bool

Whether this client has a pouch at all. False on every server except DragonFire. Ask this once before a script leans on the rest.

Example
if not pouchExists() { stop }
pouchIsOpen returns bool
pouchIsOpen() -> bool

True while the pouch window is up. Nothing else here does anything while it is false, and it is a confident false on a server with no pouch.

Example
if not pouchIsOpen() { return 600 }
pouchItem returns pouchitem?
pouchItem(id: int) -> pouchitem?pouchItem(name: string) -> pouchitem?

The pouched stack of this item, or none.

The pouched stack with this name, or none.

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

Which pouch 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 = pouchMissing()
pouchWithdraw does something returns bool
pouchWithdraw(id: int, amount: int) -> boolpouchWithdraw(name: string, amount: int) -> bool

Takes items out of the pouch and waits for them to appear in the bag. The amount is clamped to what the pouch holds, as the client's own withdraw clamps it.

Takes items out of the pouch 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 pouchWithdraw(151, 10) { return 1000 }
if not pouchWithdraw("Coal", 10) { return 1000 }
pouchWithdrawAll does something returns bool
pouchWithdrawAll(id: int) -> bool

Takes every one of this item out of the pouch and waits for them to arrive.

ParameterTypeWhat it does
idrequired int the item id
Example
pouchWithdrawAll(151)