UOX3 Script Engine

API and Event handling

Socket Related Methods

SysMessage
Prototype
void SysMessage( string message );
PurposeSends a string as a sysmessage.
Example of Usage
mySock.SysMessage( "Isn't the world great?" );

 

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 SysMessage( string message );
PurposeOpens a specified URL in player's browser
Example of Usage
mySock.OpenUrl( "http://www.uox3.org" );

 

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 );

 

Midi
Prototype
void Midi( midiNum );
PurposePlays the specified midi.
Example of Usage
mySock.Midi( 0x01 );

 

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 );
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 );

 

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

 

GetWord
Prototype
unsigned short GetWord( offset );
PurposeReturn a 16bit word from a socket at offset
Example of Usage
var cName = sock.GetWord( 0 );

 

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

 

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

 

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

 

SetString
Prototype
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)