UOSAGAS Scripting

Objects & Fields

Finder functions return plain Lua tables. These are the fields — a table is a snapshot of the object at the moment you fetched it; re-find when you need fresh values.

Player properties

Read directly on the global Player table, e.g. Player.Hits. All read-only.

FieldTypeDescription
Backpack table Your backpack as an item table, or nil if not available.
ColdResistance number Cold resistance.
DamageMax number Maximum weapon damage.
DamageMin number Minimum weapon damage.
DefenseChanceIncrease number Defense chance increase.
Dex number Dexterity.
DiffHits number Missing hit points (HitsMax - Hits).
DiffWeight number Remaining carry capacity (MaxWeight - Weight).
Direction string Facing direction as a name, e.g. 'North'.
Distance number Distance in tiles (0 for yourself).
EnergyResistance number Energy resistance.
FireResistance number Fire resistance.
Followers number Current follower count.
Gold number Gold shown on the status bar.
Graphic number Body graphic id.
HitChanceIncrease number Hit chance increase.
HitPointsRegeneration number Hit point regeneration bonus.
Hits number Current hit points.
HitsMax number Maximum hit points.
Hue number Skin hue.
Int number Intelligence.
IsDead boolean True if you are dead.
IsDestroyed boolean True if the entity has been removed from the world.
IsFemale boolean True if the character is female.
IsFlying boolean True while flying (gargoyles).
IsGargoyle boolean True if the character is a gargoyle.
IsHidden boolean True while hidden.
IsHuman boolean True if the body is human.
IsMounted boolean True while riding a mount.
IsParalyzed boolean True while paralyzed.
IsPoisoned boolean True while poisoned.
IsRenamable boolean True if the mobile can be renamed.
IsRunning boolean True while running.
IsYellowHits boolean True if the health bar is yellow (invulnerable).
LowerManaCost number Lower mana cost.
LowerReagentCost number Lower reagent cost.
Luck number Luck.
Mana number Current mana.
ManaRegeneration number Mana regeneration bonus.
MaxFollowers number Maximum follower count.
MaxMana number Maximum mana.
MaxStam number Maximum stamina.
MaxWeight number Maximum carry weight.
Name string Character name.
NotorietyFlag string Notoriety as a name: 'Innocent', 'Ally', 'Gray', 'Criminal', 'Enemy', 'Murderer' or 'Invulnerable'.
PhysicalResistance number Physical resistance.
PoisonResistance number Poison resistance.
Race string Race name.
ReflectPhysicalDamage number Reflect physical damage.
Serial number Your character's serial.
SpeedMode string Movement speed mode (currently always 'Normal').
SpellDamageIncrease number Spell damage increase.
Stam number Current stamina.
StaminaRegeneration number Stamina regeneration bonus.
StatsCap number Total stat cap.
Str number Strength.
SwingSpeedIncrease number Swing speed increase.
TithingPoints number Tithing points (paladin).
Title string Character title.
Weight number Current carried weight.
X number Map X coordinate.
Y number Map Y coordinate.
Z number Map Z coordinate (elevation).

Item fields

Fields of the table returned by the Items finders.

FieldTypeDescription
Amount number Stack amount.
Container number Serial of the direct parent container (0 when on the ground).
Direction string Direction as a name.
DisplayedGraphic number Graphic actually rendered (can differ from Graphic, e.g. corpses).
Distance number Distance from you in tiles.
Graphic number Item graphic id (item type).
Hue number Color hue.
IsArmor boolean True if the tiledata classifies the item as armor.
IsCoin boolean True for coin graphics (gold etc.).
IsContainer boolean True if the tiledata classifies the item as a container.
IsCorpse boolean True if the item is a corpse.
IsDamageable boolean True if the item can be attacked/damaged.
IsDestroyed boolean True if the item has been removed from the world.
IsEmpty boolean True if the container holds no items.
IsHidden boolean True if the item is hidden.
IsLocked boolean True if the item cannot be moved.
IsLootable boolean True if the corpse/item can be looted.
IsMulti boolean True for multi objects (houses, boats).
IsWeapon boolean True if the tiledata classifies the item as a weapon.
IsWearable boolean True if the item can be equipped according to tiledata.
Items table Reserved for contained items; not populated by the current API - use Items.GetContainerItems(item.Serial) instead.
Layer string Equipment layer the item is currently worn on (e.g. 'OneHanded', 'Backpack'; 'Invalid' when not equipped).
LightID number Light source id.
MultiGraphic number Graphic of the multi object.
Name string Item name (may be empty until the item has been seen/clicked).
OnGround boolean True if the item lies on the ground (not in a container).
Price number Vendor price (in buy/sell context).
Properties string Object property list as text (name plus properties, newline-separated), or nil if not available.
RootContainer number Serial of the top-level container (e.g. the mobile carrying it).
Serial number Item serial.
TileLayer string Equipment layer according to tiledata - also set for items lying in containers.
X number X coordinate (map position, or slot position inside a container).
Y number Y coordinate (map position, or slot position inside a container).
Z number Z coordinate (elevation).

Mobile fields

Fields of the table returned by the Mobiles finders.

FieldTypeDescription
DiffHits number Missing hit points (HitsMax - Hits).
Direction string Facing direction as a name, e.g. 'North'.
Distance number Distance from you in tiles.
Graphic number Body graphic id.
Hits number Current hit points (for others, often scaled 0-25 by the server).
HitsMax number Maximum hit points.
Hue number Skin/body hue.
IsDead boolean True if the mobile is dead.
IsDestroyed boolean True if the mobile has been removed from the world.
IsFemale boolean True if the mobile is female.
IsFlying boolean True while flying (gargoyles).
IsGargoyle boolean True if the mobile is a gargoyle.
IsHidden boolean True while hidden.
IsHuman boolean True if the body is human.
IsMounted boolean True while riding a mount.
IsParalyzed boolean True while paralyzed.
IsPoisoned boolean True while poisoned.
IsRenamable boolean True if the mobile can be renamed (e.g. your pet).
IsRunning boolean True while running.
IsYellowHits boolean True if the health bar is yellow (invulnerable).
Mana number Current mana (usually only known for yourself and party).
MaxMana number Maximum mana.
MaxStam number Maximum stamina.
Name string Mobile name (may be empty until seen/clicked).
NotorietyFlag string Notoriety as a name: 'Innocent', 'Ally', 'Gray', 'Criminal', 'Enemy', 'Murderer' or 'Invulnerable'.
Race string Race name.
Serial number Mobile serial.
SpeedMode string Movement speed mode (currently always 'Normal').
Stam number Current stamina.
Title string Mobile title.
X number Map X coordinate.
Y number Map Y coordinate.
Z number Map Z coordinate (elevation).

Gump fields

Fields of the table returned by Gumps.GetGump.

FieldTypeDescription
Serial number Server gump id (use it with Gumps.Reply etc.).
X number Screen X position of the gump.
Y number Screen Y position of the gump.
Width number Gump width in pixels.
Height number Gump height in pixels.
Texts table 1-indexed array of the gump's text lines.