Xelagot action script

Server statements

Script statements are subject to change while the Server/Client is in beta testing

Version 2.999971

See Server and action script for specific information about the Server, and Events: Server events for how to use the event handlers.

Variables shown in black may be substituted by literal values, variables shown in red are assigned the result of the operation, variables in green may not be substituted by their literal equivalents.

Preparation. The Server can be configured and connected using the user interface. The necessary Server list can only be managed from there, but the actual port number can be set by the script.

ServerPort %p
sets the Server's port number. Clients must use this port number to connect.
ServerReconnect On
ServerReconnect Off
Enables or disables automatic reconnection after an interruption. Note: as long as the Server has not openened a connection, automatic reconnection does not work.
ServerReconnectDelay %d
sets the delay in seconds between attempts to reconnect.
ServerReconnectAttempts %d
sets the number of attempts to reconnect before the pause.
ServerReconnectPause %d
sets the pause in seconds between batches of attempts to reconnect.
ServerReconnectCycles %d
sets the number of times the reconnectattempts/pause cycle has to be repeated. If the value is set to -1, the cycles are always repeated.

Once the Server is set up properly, event handlers must be installed, see Events: Server events. Then the Server can connect and disconnect to the internet. This can be done through the user interface and through scripts.

opens a listening connection at the specified port. Before doing so, closes a connection if one is open.
closes a listening connection (if open), disconnecting any online clients.

If the server has a listening connection open and the proper event handlers have been installed, ClientConnect, ClientRead and ClientDisconnect events will occur. ClientRead events can only be trapped by the script if the client has been 'captured'. See ClientRead event for how to receive messages.

ClientCapture $n
captures a client with Login name $n to receive ClientRead events from it
ClientRelease $n
releases a client with Login name $n to stop receiving ClientRead events from it
IfClientIsOnline $n statement1
Else statement2
executes statement1 if client with Login name $n is online, otherwise optionally executes statement2
Communication with the Server's clients is done with ClientWritexxx statements.
ClientWriteLogin $n $a
sends string $a to client $n
ClientWriteAll $a
sends string $a to all online clients
ClientWriteLoginX $n $a
sends string $a to all except to client $n