UOX3 Script Engine

API and Event handling

Socket Related Methods

SysMessage
Prototype
void SysMessage( string message, ... );
PurposeSends a string as a sysmessage. Accepts up to 10 additional arguments which can be injected into the string as needed.
Example of Usage
mySock.SysMessage( "Isn't the world great?" );
	mySock.SysMessage( GetDictionaryEntry(388), myNPC.name ); // Hello sir! My name is %s and I will be working for you.

 

Disconnect
Prototype
void Disconnect();
PurposeDisconnect a client.
Example of Usage
mySock.Disconnect();

 

SoundEffect
Prototype
SoundEffect( sound, bAllHear );
PurposeTo play the selected sound to this socket or all in range.
Example of Usage
pSock.SoundEffect( 0x01, false);

 

CustomTarget
Prototype
void CustomTarget( tNum, toSay );
PurposeVery similar to PopUpTarget. It's a callback situation instead. tNum must be between 0 and 255. Says toSay, and shows a cursor. Reenters the script associated with the socket's player (ie player who gets the cursor). Enters function name based on the value of tNum. if tNum is 0, then the function would be onCallback0. Prototype of callback is:
function onCallback0( tSock, targSerial )
Example of Usage
mySock.CustomTarget( 0, "Select your custom target:" );

 

PopUpTarget
Prototype
void PopUpTarget( tNum, toSay );
PurposeProvides a call to an inbuilt popup target. tNum must be between 0 and 255 inclusive. Says toSay, and shows a cursor. Note that this allows access potentially to GM functions.
Example of Usage
mySock.PopUpTarget( 2, "Where do you wish to teleport to?" );

 

OpenURL
Prototype
void OpenURL( UrlString );
PurposeOpens a specified URL in player's browser
Example of Usage
mySock.OpenURL( "http://www.uox3.org" );

 

OpenGump
Prototype
void OpenGump( gumpMenuID );
PurposeOpens specified gumpmenu from dfndata\misc\gumps.dfn for socket
Example of Usage
mySock.OpenGump( 1 );

 

SellTo
Prototype
void SellTo( targNPC );
PurposeBrings up the shopkeeper gump for selling to a vendor targNPC.
Example of Usage
mySock.SellTo( myNPC );

 

BuyFrom
Prototype
void BuyFrom( targNPC );
PurposeBrings up the shopkeeper gump or PV backpack for buying for vendor targNPC.
Example of Usage
mySock.BuyFrom( myNPC );

 

WhoList
Prototype
void WhoList( bSendOnList );
void WhoList();
PurposeSends the WhoList populated with all online characters or all offline characters.
Example of Usage
mySock.WhoList( true );

 

Music
Prototype
void Music( musicNum );
PurposePlays the specified music.
Example of Usage
mySock.Music( 1 );

 

GetTimer
Prototype
void GetTimer( timerID );
PurposeReturns the specified timer value
Extra InfoCurrent valid Socket timers are:
	tPC_SKILLDELAY		= 0
	tPC_OBJDELAY		= 1
	tPC_SPIRITSPEAK		= 2
	tPC_TRACKING		= 3
	tPC_FISHING		= 4
	tPC_MUTETIME		= 5
	tPC_TRACKINGDISPLAY	= 6
Example of Usage
mySock.GetTimer( 3 );

 

SetTimer
Prototype
void SetTimer( timerID, numMilliSeconds );
PurposeSets the specified timer with the amount of miliseconds until it expires.
Example of Usage
mySock.SetTimer( 3, 1000 );

 

GetByte
Prototype
unsigned char GetByte( offset );
PurposeReturn a byte from a socket at offset, positive value assumed
Example of Usage
var cName = sock.GetByte( 0 );

 

GetSByte
Prototype
signed char GetSByte( offset );
PurposeReturn a byte from a socket at offset, negative valus accepted
Example of Usage
var cName = sock.GetSByte( 0 );

 

GetWord
Prototype
unsigned short GetWord( offset );
PurposeReturn 2 bytes of data from socket at offset, positive value assumed
Example of Usage
var cName = sock.GetWord( 0 );

 

GetSWord
Prototype
signed short GetSWord( offset );
PurposeRetur 2 bytes of data from socket at offset, negative value accepted
Example of Usage
var cName = sock.GetSWord( 0 );

 

GetDWord
Prototype
unsigned short GetDWord( offset );
PurposeReturn 4 bytes of data from socket at offset, positive value assumed
Example of Usage
var cName = sock.GetDWord( 0 );

 

GetSDWord
Prototype
unsigned short GetSDWord( offset );
PurposeReturn 4 bytes of data from socket at offset, negative value accepted
Example of Usage
var cName = sock.GetSDWord( 0 );
GetString
Prototype
string GetString( offset [, len] );
PurposeReturn a string from a socket at offset with optional length len
Example of Usage
var sName = sock.GetString( 0 );

 

SetByte
Prototype
void SetByte( offset, value );
PurposeSets the byte at offset for socket to value
Example of Usage
sock.SetByte( 0, 64 );

 

SetWord
Prototype
void SetWord( offset, value );
PurposeSets the 16bit word at offset for socket to value
Example of Usage
sock.SetWord( 0, 0164 );

 

SetDWord
Prototype
void SetDWord( offset, value );
PurposeSets the 32bit word at offset for socket to value
Example of Usage
sock.SetDWord( 0, 01640164 );

 

SetString
Prototype
void SetString( offset, value );
PurposeSets the string at offset for socket to value
Example of Usage
sock.SetString( 0, "Die!" );

 

ReadBytes
Prototype
ReadBytes( bytecount );
PurposeReads bytecount bytes from socket
Example of Usage
sock.ReadBytes( 12 );

 

DisplayDamage
Prototype
void DisplayDamage( pUser, damage );
Purpose Displays specified damage value over character's head
Example of Usage
socket.DisplayDamage( pUser, 15 );

 

SendAddMenu
Prototype
bool SendAddMenu( menuNum );
Purpose Send the Add-menu to the character
Example of Usage
socket.SendAddMenu( 1 );
Original: ©Copyright 2000-2001 WWW.UOX3.NET (Daniel Stratton/Matthew Randall) ||| Rewrite: ©Copyright 2002 WWW.UOXDEV.DE (Florian "Rukus" Frick)