Class Hierarchy
                UObject             Account      PolCore()       DataFileElement
                   |
                   |                Guild        Script          Datastore
         +---------+--------+
         |                  |       Array        Dictionary      Datafile
       Character           Item
         |                  |       AuxConnection   Error        String
        NPC                 |
                            |                                    Struct
         +------------------+--------------+-----------+
         |                  |              |           |         Package
     Equipment           Lockable         Map        Multi
         |                  |                          |         Packet
     +---+----+        +----+--------+            +----+----+
     |        |        |             |            |         |
    Armor  Weapon     Door        Container      Boat     House
                                     |
                                +----+----+
                                |         |
                             Spellbook   Corpse

Last Modified: 10/27/2007

Account
Explanation
Object describing a player's game account
Members
Name | Type | Desc | Access
name | String | the name of the account | r/o
enabled | boolean | true if enabled | r/o
banned | boolean | true if banned | r/o
passwordhash | string | MD5 password hash string | r/o
usernamepasswordhash | string | MD5 username+password hash string | r/o
uo_expansion | string | used uo-expansion | r/o
defaultcmdlevel | Integer | the number for the accounts default command level | r/o
Methods
Prototype | Returns | Desc
addcharacter(index) | nothing/error | If Index is 0 (.AddCharacter(0)), it will find the next available slot on the account. (Otherwise pass 1-5) Will create a naked, uncolored, male character named 'new character' at 1, 1, 1 on Britannia. No scripts are ran for this method of character creation. Edit this new character via the script creating it.
ban() | true | bans the account
unban() | true | unbans the account
enable() | true | enables the account
disable() | true | disables the account
setpassword(string newpass) | true/error | sets the account password to newpass
checkpassword(string pass) | boolean/error | returns true if 'pass' is the account's password
setname(string newname, string newpass) | true/error | sets the account name to newname, newpass optional
getcharacter(integer slot) | true/OfflineCharacterRef | gets an OfflineCharacterRef for the character in slot 'slot'. returns error if not character in that slot (1..5)
deletecharacter(integer slot) | true/error | Deletes character in slot 'slot'. returns error if not character in that slot (1..5)
delete() | true/error | Delete this empty account.
split(string newacctname, integer slot) | true/error | Create a new account and move character to it.
move_char(string destacctname, integer slot) | true/error | Move character from this account to destination account. You can use it to flip chars on same account too.
getprop(string propname) | true/error | GetObjProperty for account objects.
setprop(string propname, propval) | true | SetObjProperty for account objects.
eraseprop(string propname) | true | EraseObjProperty for account objects.
propnames() | Array | returns an array of cprop names on this account
set_uo_expansion(string expansion) | true/error | This determines what flag is sent with packet 0xB9 during login (Nothing -> 0x0000 / T2A -> 0x0001 / LBR -> 0x0002 / AOS -> 0x801b / SE -> 0x805b / ML -> 0x80db). It's possible to hook 0xB9 but don't forget to set_uo_expansion anyway because core uses this for internal flags (e.g. AoS Tooltips). The servspecopt.cfg UOFeatureEnable is used with packet 0xA9 and is currently global to all clients. Recognized values: ML, SE, AOS, LBR, T2A (default).
setdefaultcmdlevel(integer number) | true/error | Set the account's default command level.

Armor
Parent
Equipment
Explanation
Equipable items that protect against damage in combat
Members
Name | Type | Desc | Access
ar_mod | integer | Armor factor modifier | r/w
ar | integer | Modified armor factor | r/o
ar_base | integer | Base armor factor (as in itemdesc.cfg) | r/o
onhitscript | string | Script name that runs when armor is hit | r/w

Array
Explanation
Data structure for linear storage, dynamically resizes to fit more elements. Declare with var a := array;
Methods
Prototype | Returns | Desc
exists(index) | error/int | Returns 1 if index is in array.
size() | int | number of elements in the array
erase(int index) | true/false | erases the element at index
insert(int index, object) | void/error | inserts a new object into the array at index
shrink(index) | true/error | erases index to end of array
append(object) | true/error | inserts object in the end of the array
reverse() | true | reverses the elements of the array
sort() | true | sorts the elements of the array
+ array | array | concatinates 2 arrays

AuxConnection
Explanation
An object passed to an Aux Service Script that allows the script to transmit and recieve packed data over a TCP/IP port. use wait_for_event() in the service script to recieve data.
Members
Name | Type | Desc | Access
ip | string | Originating IP on the AuxConnection Pipe | r/o
Methods
Prototype | Returns | Desc
transmit(object o) | error/0 | Transmits the packable object 'o' over the Aux connection.

Boat
Parent
Multi
Explanation
A Multi object that moves in water.
Members
Name | Type | Desc | Access
items | array | Array of Item References on the deck of the boat | r/o
mobiles | array | Array of Character References on the deck | r/o
has_offline_mobiles | boolean | true if players are logged out on the deck | r/o
tillerman | Item | ItemRef to the tillerman item | r/o
portplank | Item | ItemRef to the left-side plank item | r/o
starboardplank | Item | ItemRef to the right-side plank item | r/o
hold | Item | ItemRef to the hold container item | r/o
Methods
Prototype | Returns | Desc
move_offline_mobiles(int x, int y, int z[, string realm]) | true/false | moves offline mobiles on boat to x,y,z. If realm is not set, Boat-realm is used.

Character
Parent
UObject
Children
NPC
Explanation
A mobile object that exists in the world (NPC or player character)
Members
Name | Type | Desc | Access
warmode | integer | 1 if in warmode | r/o
gender | integer | 0=male 1=female | r/w
trueobjtype | integer | original objtype | r/w
truecolor | integer | original color | r/w
ar_mod | integer | Armor factor modifier | r/w
hidden | boolean | 1 = normal players cannot see | r/w
concealed | integer | concealed below this value cannot see | r/w
frozen | boolean | 1 = player is frozen (by a GM) | r/w
paralyzed | boolean | 1 = player is paralyzed | r/w
poisoned | boolean | 1 = player is poisoned | r/w
stealthsteps | integer | number of walk steps left until player is revealed | r/w
squelched | integer | 1 = player cannot speak | r/o
dead | integer | 1 = player is dead | r/o
ar | Integer | Total armor factor. If it's an NPC without armor equipped, it will return its intrinsic armor value taken from NpcDesc AR entry. | r/o
shield | Armor | Returns the ItemRef of the sheild, if any, is worn. | r/o
backpack | Item | Reference to character's pack (if any) | r/o
trading_with | CharRef | Reference to character they are trading with (if any) | r/o
weapon | Item | Reference to character's weapon (if any) | r/o
acct | integer | Account Reference (if not NPC) | r/o
acctname | Account | Account name string (if not NPC) | r/o
cmdlevel | integer | command level of character | r/w
cmdlevelstr | String | string name of command level | r/o
criminal | integer | 1 = player is criminal (gray) | r/o
ip | String | IP Address string | r/o
isUOKR | Boolean | True if the client being used is an UO:KR client | r/o
cursor | Boolean | True if the client has an active target cursor | r/o
gump | Boolean | True if the client has any active gumps from SendGump | r/o
prompt | Boolean | True if the client has any active String or Unicode prompt windows | r/o
gold | integer | Amount of gold in character's pack | r/o
title_prefix | String | String placed before name i.e. Lord Racalac | r/w
title_suffix | String | String placed after name i.e. Racalac the Brave | r/w
title_guild | String | String guild title i.e. [ROX, super d00d] Racalac | r/w
title_race | String | String race title after suffix in paperdoll | r/w
guildid | integer | guild ID number | r/o
guild | Guild | guild object reference | r/o
murderer | boolean | 1 = player flagged murderer (red) | r/w
attached | Script | Script reference for attached script | r/o
reportables | Array | (reputation system) Array of Structs: { serial, killer, gameclock }, serial = killer's serial, killer = 'offline mobile reference' to the killer, gameclock = game time when the death occurred | r/o
clientversion | string | UO Client version string | r/o
clientinfo | Struct | UO Client information struct (check out core-changes.txt for an example) | r/o
delay_mod | integer | Weapon Delay modifier | r/w
createdat | integer | PolClock when character was created | r/o
opponent | MobileRef | Mobile reference if a combat opponent is selected. | r/o
connected | Boolean | To determine if the character is actively connected to the game. Is set to 1 before logon/reconnect scripts are run and 0 right before logofftest is run. Will return 1 on NPC. | r/o
getcorpse | ItemRef | Most recent Corpse made. | r/o
uclang | String | Reports the Unicode Language string client sends during logon. | r/o
race | Integer | Set/get the ML race (new constants in UO.EM: RACE_HUMAN, RACE_ELF). You have to set visual graphic by yourself if you change value (Human male/female = 0x190/0x191 / Elf male/female = 0x25d/0x25e). You can choose Race at Char creation if your UOExpansion and UOFeature settings fit. | r/w
Methods
Prototype | Returns | Desc
setpoisoned(bool) | true/error | sets the character poisoned, controller of calling script is flagged as in repsystem
setparalyzed(bool) | true/error | sets the character paralyzed, controller of calling script is flagged as in repsystem
setcriminal(int level) | true/error | sets the character criminal. level multiplies the CriminalFlagInterval as defined in repsys.cfg. level=0 clears criminal timer.
setlightlevel(int level, int duration) | true | sets the light level of the character to 'level' for 'duration' seconds
squelch(int duration) | true | character cannot talk for 'duration' seconds. -1 means forever. 0 clears the squelch
enable(string setting) | true/error | enables the 'granted' privilage to the character
disable(string setting) | true | disables the 'granted' privilage to the character
enabled(string setting) | true/false | true if the privilage is enabled
privileges() | dictionary | Dictionary where keys are privilege name, value is 0/1 boolean.
setcmdlevel(string cmdlevel) | true/error | grants the command level to the char as defined in cmds.cfg
spendgold(int amount) | true/error | if enough gold, removes it from the player's pack
setmurderer(bool) | true/error | flags the character as a murderer (red)
removereportable(int serial, int gameclock) | true/error | removes the killer with 'serial' from the reportables list that was added at 'gameclock'
getgottenitem() | error/ItemRef | returns an ItemRef to the item held on the player's cursor, if any.
cleargottenitem() | true/error | Returns 'dragged' item to original location.
setwarmode(boolean) | integer/error | Sets the internal warmode flag and sends the update to the player. Returns the new warmode value.

Container
Parent
Lockable
Children
Corpse
Explanation
Items that can be locked, and have other items inside them

Corpse
Parent
Lockable
Explanation
Objects that are created when character objects are killed
Members
Name | Type | Desc | Access
corpsetype | Integer | ObjType of the Character killed | r/o
ownerserial | Integer | Serial of the Mobile that died | r/o

Datafile
Explanation
Object representing a data file in a data store
Methods
Prototype | Returns | Desc
CreateElement(key) | error/DataFileElemRef | key is int or string, depending on datafile flags
FindElement(key) | error/DataFileElemRef | see key notes above
DeleteElement(key) | error/true | see key notes above
Keys() | array | array of ints or strings, depending on datafile flags

DataFileElement
Explanation
A data element inside a datastore file
Methods
Prototype | Returns | Desc
GetProp(string propname) | script object/error | Returns an unpacked script object (i.e. int,string,array,etc)
SetProp(string propname, object propvalue) | true/error | Sets a packable object to a property
EraseProp(string propname) | true/error | Erases the property named 'propname'
PropNames() | array | Returns an array of property name strings

Datastore
Explanation
Functions for manipulating a datastore. Not an actual object, but funcs found in datafile.em, presented here for completeness.
Methods
Prototype | Returns | Desc
CreateDataFile(string name, int flags) | DataFileRef/error | Creates a datafile
OpenDataFile(string name) | DataFileRef/error | Opens a datafile
UnloadDataFile(string name) | true/error | Unloads a datafile

Dictionary
Explanation
Data structure for key->value pairs (i.e."associative array"). Keys may be intgers, strings, reals, mobrefs, or itemrefs. Declare with var d := dictionary;
Methods
Prototype | Returns | Desc
size() | int | number of pairs in dictionary
erase(key) | true/error | erases a pair from the dict
insert(key, value) | error/int | inserts a pair into the dict, returns new size
exists(key) | error/int | if exists, returns count of matching key
keys() | array | returns an array of the keys
[key] | value | gets value at key, or uninit if key doesn't exist

Door
Parent
Lockable
Explanation
A door item that automatically closes.
Members
Name | Type | Desc | Access
isopen | boolean | true if the door is open | r/o
Methods
Prototype | Returns | Desc
open() | true | opens the door
close() | true | closes the door
toggle() | true | toggles the door to the other state

Equipment
Parent
Item
Children
Weapon
Armor
Explanation
Class containing concrete subclasses which are equipable and have hit points
Members
Name | Type | Desc | Access
quality | float | 1.0=Average | r/w
hp | integer | Hit points of item | r/w
maxhp_mod | integer | Maximum Hit Point modification | r/w
maxhp | integer | Maximum Hit Points of item | r/o

Error
Explanation
An object representing a script error. Comparing this object against the keyword 'error' allows the scripter to know if the result of a core function was an error.
Members
Name | Type | Desc | Access
errortext | string | Informational Error string | r/w

Guild
Explanation
Object representing a player guild association
Members
Name | Type | Desc | Access
members | array | Array of Character Refs who are guild members | r/o
allyguilds | array | Array of GuildRefs who are allied guilds | r/o
enemyguilds | array | Array of GuildRefs who are enemy guilds | r/o
guildid | integer | Guild ID number | r/o
Methods
Prototype | Returns | Desc
ismember(Character) | error/true | true if the character is a member of the guild
isallyguild(GuildRef) | true/error | true if the guild is an ally
isenemyguild(GuildRef) | true/error | true if the guild is an enemy
addmember(CharacterRef) | true/error | adds a character to the guild
addallyguild(GuildRef) | true/error | adds an ally guild
addenemyguild(GuildRef) | true/error | adds an enemy guild
removemember(CharacterRef) | true/error | removes a character member
removeallyguild(GuildRef) | true/error | removes an ally guild
removeenemyguild(GuildRef) | true/error | removes an enemy guild

House
Parent
Multi
Explanation
A Multi object where players hoard items.
Members
Name | Type | Desc | Access
components | Array | Array of House components, i.e. sign, doors | r/o
items | Array | Array of Item References in the house | r/o
mobiles | Array | Array of Character References in the house | r/o
custom | Boolean | 1 = custom house (for upcoming custom house support) | r/o
Methods
Prototype | Returns | Desc
add_component(ItemRef) | true/error | Add item to House components
erase_component(ItemRef) | true/error | Erase item from House components

Item
Parent
UObject
Children
Equipment
Lockable
Map
Multi
Explanation
Represents a physical item in the world.
Members
Name | Type | Desc | Access
amount | integer | stack size | r/o
layer | integer | equipment layer | r/o
container | Item | item contained in | r/o
usescript | string | double-click action script. set to empty string for itemdesc.cfg default script. | r/w
equipscript | string | script run when item equipped on a character | r/w
unequipscript | string | script run when item unequipped | r/w
desc | string | single click description string (formatted name) | r/o
movable | boolean | true if player may move the item | r/w
invisible | boolean | true if the item is invisible | r/w
decayat | integer | game clock value after which this item might decay | r/o
sellprice | integer | Amount of gold an NPC sells this item for. 0=not for sale, -1=itemdesc default. | r/w
buyprice | integer | Amount of gold an NPC buys this item for. 0=not for sale, -1=itemdesc default. | r/w
newbie | boolean | true if the item remains with the ghost when player dies | r/w
item_count | integer | number of items in container (or 1 if this item is not a container) | r/o

Lockable
Parent
Item
Children
Door
Container
Explanation
Class containing concrete subclasses which can 'lock'
Members
Name | Type | Desc | Access
locked | boolean | true if the item is locked | r/w

Map
Parent
Item
Explanation
A Map item that shows a a map image in a gump when double clicked.
Members
Name | Type | Desc | Access
xeast | integer | east gump edge (world coord) | r/w
xwest | integer | west gump edge (world coord) | r/w
ynorth | integer | north gump edge (world coord) | r/w
ysouth | integer | south gump edge (world coord) | r/w
gumpwidth | integer | width in pixels of map gump | r/w
gumpheight | integer | height in pixels of map gump | r/w
Methods
Prototype | Returns | Desc
getpins() | array | returns array of structs{x,y} of pins for the map
insertpin(int index, int x, int y) | true/error | insert pin{x,y} before index
appendpin(int x, int y) | true/error | append pin{x,y} to end of course
erasepin(int index) | true/error | erase pin at index

Multi
Parent
Item
Children
House
Boat
Explanation
Special items that display as many pieces of a large structure, as defined in multi.cfg
Members
Name | Type | Desc | Access
footprint | struct | returns a struct with 'xmin', 'xmax', 'ymin', 'ymax' of the world coordinates the multi occupies. | r/o

NPC
Parent
Character
Explanation
A Non-Player Character mobile object
Members
Name | Type | Desc | Access
alignment | integer | NPC template alignment. | r/o
npctemplate | string | NPC template name in npcdesc.cfg | r/o
master | Character | controlling player character, false if none | r/o
process | Script | Control script reference, error on none | r/o
eventmask | integer | bitwise-ORd list of sysevents that have been enabled, error if no control script running | r/o
speech_color | integer | NPC speech text color | r/w
speech_font | integer | NPC speech text font | r/w
script | string | control script name | r/w
use_adjustments | boolean | Use movement adjustments to avoid single-tile obsticals | r/w
run_speed | integer | NPC walk delay (maximum 250) | r/w
Methods
Prototype | Returns | Desc
setmaster(CharacterRef master) | true/false | Sets the master character for the NPC, if not passed, clears master.
canmove(String direction, or Integer facing) | true/false | Checks if an NPC can move in given direction (IsLegalMove works in a different way and is used for bounding boxes only).
privileges() | dictionary | Dictionary where keys are privilege name, value is 0/1 boolean.

Package
Explanation
Object representing a package in the system
Members
Name | Type | Desc | Access
name | string | Package name | r/o
supports_http | boolean | Does the Package supports www? | r/o
npcdesc | boolean | Does the Package hold an own npcdesc.cfg? | r/o

Packet
Explanation
Object representing a binary packet. Print(Packet) returns string of Packet contents.
Methods
Prototype | Returns | Desc
SendPacket(Character) | true/error | Sends this packet to character.
SendAreaPacket(int x, int y, int range, string realm) | integer/error | Sends this packet to all the players in range of x,y. Returns integer number of clients this packet was successfully sent to.
GetSize() | integer | Returns size of packet data in bytes.
GetInt8(int offset) | integer/error | Gets 8-bit (1 byte) value at offset (0-based).
GetInt16(int offset) | integer/error | Gets 16-bit (2 byte) value at offset (0-based). Automatically converts to Big-Endian.
GetInt32(int offset) | integer/error | Gets 32-bit (4 byte) value at offset (0-based). Automatically converts to Big-Endian.
GetInt16Flipped(int offset) | integer/error | Gets 16-bit (2 byte) value at offset (0-based). Automatically converts to Low-Endian.
GetInt32Flipped(int offset) | integer/error | Gets 32-bit (4 byte) value at offset (0-based). Automatically converts to Low-Endian.
GetString(int offset, int length) | string/error | Gets a string (1-byte characters) at offset (0-based) for length characters.
GetUnicodeString(int offset, int length) | array/error | Gets a 'unicode string' (2-byte characters) at offset (0-based) for length characters (NOT BYTES).
GetUnicodeStringFlipped(int offset, int length) | array/error | Gets a 'unicode string' (2-byte characters) at offset (0-based) for length characters (NOT BYTES). With Flipped Byte Order (for specific packet support)
SetSize(int newsize) | integer/error | Sets the new size of the packet, possibly destroying data if packet size was decreased. Updates the encoded size for variable length packets, not allowed for fixed-length packets. Returns the old size of the packet.
SetInt8(int offset, int value) | true/error | Sets an 8-bit (1-byte) value at offset (0-based). If offset is greater than current size, the packet is resized to fit the new data and the encoded size is updated for variable length packets. Resizing is not allowed for fixed-length packets.
SetInt16(int offset, int value) | true/error | Sets an 16-bit (2-byte) value at offset (0-based). If offset is greater than current size, the packet is resized to fit the new data and the encoded size is updated for variable length packets. Resizing is not allowed for fixed-length packets. Automatically converts to Big-Endian.
SetInt32(int offset, int value) | true/error | Sets an 32-bit (4-byte) value at offset (0-based). If offset is greater than current size, the packet is resized to fit the new data and the encoded size is updated for variable length packets. Resizing is not allowed for fixed-length packets. Automatically converts to Big-Endian. NOTE: currently there's a compiler problem setting 0xFFFFFFFF, it gets converted to 0x7FFFFFFF. Use multiple SetInt16 or SetInt8 calls for now.
SetInt16Flipped(int offset, int value) | true/error | Sets an 16-bit (2-byte) value at offset (0-based). If offset is greater than current size, the packet is resized to fit the new data and the encoded size is updated for variable length packets. Resizing is not allowed for fixed-length packets. Automatically converts to Low-Endian.
SetInt32Flipped(int offset, int value) | true/error | Sets an 32-bit (4-byte) value at offset (0-based). If offset is greater than current size, the packet is resized to fit the new data and the encoded size is updated for variable length packets. Resizing is not allowed for fixed-length packets. Automatically converts to Low-Endian. NOTE: currently there's a compiler problem setting 0xFFFFFFFF, it gets converted to 0x7FFFFFFF. Use multiple SetInt16 or SetInt8 calls for now.
SetString(int offset, string string, int nullterminate) | true/error | Sets a string value at offset (0-based). If offset plus length of string is greater than current size, the packet is resized to fit the new data and the encoded size is updated for variable length packets. Resizing is not allowed for fixed-length packets. Set nullterminate to 1 if you want to automatically append a 0 terminator.
SetUnicodeString(int offset, array unicode character, int nullterminate) | true/error | Sets a unicode string at offset (0-based). If offset plus length of string (2*number of members in the array) is greater than current size, the packet is resized to fit the new data and the encoded size is updated for variable length packets. Resizing is not allowed for fixed-length packets. Set nullterminate to 1 if you want to automatically append a double 0 terminator. Unicode strings in eScript are arrays of 2-byte values. See unicode.em for useful functions. CAscZ in basic.em is useful for character sets that use the ascii/ansi standard.
SetUnicodeStringFlipped(int offset, array unicode character, int nullterminate) | true/error | Sets a unicode string at offset (0-based). If offset plus length of string (2*number of members in the array) is greater than current size, the packet is resized to fit the new data and the encoded size is updated for variable length packets. Resizing is not allowed for fixed-length packets. Set nullterminate to 1 if you want to automatically append a double 0 terminator. Unicode strings in eScript are arrays of 2-byte values. See unicode.em for useful functions. CAscZ in basic.em is useful for character sets that use the ascii/ansi standard. With Flipped Byte Order (for specific packet support)

Polcore
Explanation
Object containing server data
Members
Name | Type | Desc | Access
itemcount | integer | Total Item Count | r/o
mobilecount | integer | Total Mobile Count | r/o
uptime | integer | Uptime in seconds | r/o
sysload | integer | System Load | r/o
sysload_severity | integer | System Load Severity | r/o
bytes_sent | integer | Number of bytes sent | r/o
bytes_received | integer | Number of bytes received | r/o
version | integer | Version, i.e. 95 | r/o
systime | integer | UNIX time() | r/o
events_per_min | integer | Events per minute | r/o
skill_checks_per_min | integer | Skill checks per minute | r/o
combat_operations_per_min | integer | Combat operations per minute | r/o
error_creations_per_min | integer | Script errors per minute | r/o
tasks_ontime_per_min | integer | Tasks ontime per minute | r/o
tasks_late_per_min | integer | Tasks late per minute | r/o
tasks_late_ticks_per_min | integer | Tasks late ticks per minute | r/o
instr_per_min | integer | Script instructions per minute | r/o
priority_divide | integer | Priority Divide | r/o
verstr | string | Version String | r/o
compiledate | string | Compile Date | r/o
compiletime | string | Compile Time | r/o
packages | array | Array of enabled package names | r/o
all_scripts | array | Array of all cached script objects | r/o
script_profiles | array | Array of structs: struct have members name, instr, invocations, instr_per_invoc, instr_percent | r/o
iostats | integer | struct of arrays of structs - iostats["sent"array->256 elements of struct["count","bytes"],"received"array->256 elements of struct["count","bytes"]] | r/o
queued_iostats | array | structure same as iostats, but for queued I/O stats | r/o
Methods
Prototype | Returns | Desc
log_profile(bool clear) | true/false | Writes the script profile to the log, optionally clearing it after.
set_priority_divide(int divide) | true/false | Sets the priority divide to 'divide'
clear_script_profile_counters() | true/false | Clears the script profile counters

Script
Explanation
Object representing a script in the system
Members
Name | Type | Desc | Access
pid | integer | Process ID | r/o
name | string | Script name | r/o
state | string | Script state | r/o
instr_cycles | integer | Instruction Cycles | r/o
sleep_cycles | integer | Sleep Cycles | r/o
consec_cycles | integer | Consecutive Cycles | r/o
PC | integer | Program Counter | r/o
call_depth | integer | Call depth | r/o
num_globals | integer | Number of global variables | r/o
var_size | integer | Number of variables | r/o
globals | Dictionary | Dictionary of global variable name=>value pairs | r/o
attached_to | MobileRef | Mobile where Script is attached to. If it's an AI-Script it will return the NPC. | r/o
controller | MobileRef | Mobile which is responsible for damage etc. | r/o
Methods
Prototype | Returns | Desc
sendevent(obj event) | error/true | sends a event to this script (usually a struct)
kill() | true | Kills this script
clear_event_queue() | true | clears the event queue of the script

String
Explanation
An ordered collection of ascii (1-byte) characters. Declare with var s := "my string"
Methods
Prototype | Returns | Desc
[start,length] | string | 'Substring': returns a new string from the character range between start and length, inclusive. Returns error if index out of range. Ex: var str := "yomama"; str[2,3] would return "oma".
[substr] | string/uninit | seaches the string for 'substr'. If found, returns the first character of the substring, else uninitialized object.
[substr] := replace_str | string | finds the first occurance of 'substr' and replaces substr with 'replace_str'. returns the new string.
+ string | string | concatenates the strings, returns the new string.

Struct
Explanation
Data structure with explicitly named members (keys). Keys may be only be strings. Declare with var s := struct; Pre-intialize with: var s := struct { a := 1, b :=2 }
Methods
Prototype | Returns | Desc
exists(key) | error/int | if exists, returns count of matching key
size() | int | number of keys in the struct
insert(int index, object) | int/error | inserts a new object into the struct for key. Returns size.
keys() | array | returns an array of the keys
.+member | n/a | struct.+member adds a member
.member | value | gets value of member
[member] | value | gets value of member ONLY when member is a string! no using integers here like an array.

UObject
Children
Character
Item
Explanation
The base UO Object class
Members
Name | Type | Desc | Access
x | integer | x coordinate | r/o
y | integer | y coordinate | r/o
z | integer | z coordinate | r/o
realm | String | case-sensitive name of the realm | r/o
name | String | name string (for items use .desc for single-click text) | r/w
objtype | integer | object type as defined in itemdesc.cfg | r/o
graphic | integer | art id number | r/w
serial | integer | unique object identifier | r/o
color | integer | color value (0 to 0xFFF) | r/w
facing | integer | facing or the object (meaningful for mobiles and light-emitting items) range 0-127 | r/w
height | integer | height of the graphic as defined in tiledata.mul | r/o
weight | integer | weight of the graphic as defined in tiledata.mul | r/o
multi | Multi | MultiRef for the Multi the object is on | r/o
Methods
Prototype | Returns | Desc
isa(POLCLASS_*) | boolean | True if the derived class is the same as the passed class type (see uo.em for all constants)
set_member(string membername, obj value) | object, new value of member or error | Sets the built-in member 'membername' to 'value'. obj.set_member("name","u suck") is the same as obj.name := "u suck"
get_member(string membername | object, value of member or error | Gets the value of the built-in member 'membername'. var objname := obj.get_member("name") is the same as var objname := obj.name

Weapon
Parent
Equipment
Explanation
Equipable items that deal damage in combat
Members
Name | Type | Desc | Access
dmg_mod | integer | Damage Modifier | r/w
attribute | string | Attribute name this weapon uses as a skill | r/o
hitscript | string | Script name that runs when weapon makes a hit | r/w
intrinsic | Boolean | Intrinsic Weapon? | r/o

If you know if any information is incorrect on these pages, mail your corrections to polteam@polserver.com

Copyright ©2003-2007 David Carpman and POL Development Team, all rights reserved. DO NOT REPRODUCE, MIRROR, ALTER, SPINDLE, MUTILATE, OR SIT ON.