Objects Table

The table below lists item properties visible from Lua. Some properties require additional notes - they are included at the end of the table. Sample uses of object properties can be found here.

Property

Description

aname

Object name with correct handling of A/AN/THE

char

CH variable that item is held/worn by, or nil.

clan

Clan number if the item is from a clan

destination*

Key of destination room for a portal.

foodname

Name of drink type on a drink container

foodleft

Capacity remaining on a drink container

foodpoisoned

Returns 1 if item is poisoned food/drink

ingame

Number of items with the same object key in game

inside

OBJ type variable item is inside, or nil.

key

Returns the object key

keywords

Item keywords

level

Level of item

loctype

Location type of item. See below for details.

name

Name of item

owner*

Current owner of item

room

ROOM variable that item is in, or nil.

root

OBJ type variable of top level container. Same as obj if not in a container.

timer*

Timer in seconds, or zero for no timer.

type

Type of item as a number

typestr

Type of item as a name

uses*

Uses of item remaining - wands/portals/etc

value

Value of item

weight

Item total weight

loctype Definitions

obj.loctype: The loctype object property returns the type of location an item is in. Return values are:

Constant

Description

OBJ_LOC_PLAYER

Object is on a player

OBJ_LOC_MOB

Object is on a mob

OBJ_LOC_ROOM

Object is in a room.

OBJ_LOC_CONTAINER

Object is in a container.

OBJ_LOC_NOWHERE

Object is nowhere (auction or bug)

Related Pages