inventory

inventory <creature>

The objects a creature is carrying, as an iterable.

This is the carried-objects subset of objects: it does not include worn equipment, implants, or tattoos.

Arguments

Returns

An iterable whose elements are objects. Consume it with each, count, first, select, or another iterable consumer. An empty or unresolved argument yields null.

Examples

after command (say) {
  oload 1
  do "say I carry [count [inventory $self]] item(s)."
}

oload loads object vnum 1 onto the owner; [inventory $self] then lists what the owner carries. After the load [count ...] evaluates to 1 and the mob says "I carry 1 item(s)."

after command (say) {
  oload 1
  do "say My first item is [name [first [inventory $self]]]."
}

[first [inventory $self]] is the loaded object, whose name is "a jail strongbox", so the mob says "My first item is a jail strongbox."

See also