backIndex

Xelagot action script

Events: CitizenAttributes, Address

Refer to Events for general information.

CitizenAttributes is triggered by any reception of citizen attributes from the universe server: citizen number or citizen name.

Installer: OnCitizenAttributesEvent <eventlabel>
Event type: 600

Besides the program commands and settings which initiate a citizen attributes query at the universe server, the script language has two statements to this effect:

QueryCitnum $name for finding the citizen number of a given name
QueryCitname %number for finding the citizen number belonging to a name

A citizen attributes query can also be caused by the statements:

IdentifyCitizen &a  (see here for cit # 1 function)
Identify &a

In all cases, if this event handler is installed, it will be triggered when the information is received from the universe server.

In the event handler, you must test whether the target is defined or not, and exit if it is not:
IfTargetUndefined Escape

Specific statements (must be inside the event handler):

GetEventType %a stores the event type code in variable %a
GetEventResult %a %a is 0 if citizen attribute query has been successful, otherwise see the SDK error codes
GetCitizenAttributes %number $name
GetCitizenAttributes $name %number
if GetEventResult is 0, retrieves the citizen name and number sent by the universe server.
GetChatline $a
or
GetMessage $a
as from xelagots 3.411, if the bot is citizen 1 (universe owner), and has called IdentifyCitizen &p, this statement retrieves the comment for citizen &p from the universe database. (see here for cit # 1 function)

 

Address is triggered when the world server sends the IP address of someone. This only happens to bots with eject power (or caretakers?).

Installer: OnAddressEvent <eventlabel>
Event type: 601

Besides the program commands and settings which initiate an address (IP) query at the world server, the script language has one statement to this effect:
QueryAddress &person
This statement will trigger the Address event when the information comes back from the world server.

Specific statements (must be inside the event handler):

GetEventType %a stores the event type code in variable %a
GetEventResult %a is 0 if successful, otherwise see the SDK error codes
GetNameSessionAddress $name %session $address
if GetEventResult is 0, retrieves the citizen name and number sent by the universe server.
IfTargetDefined statement1
[Else statement2]
tests whether GetEventResult is 0 and the target person is defined, in this case, if it is present in the bot database. If defined, executes statement1. Otherwise, optionally, executes statement2
IfTargetUndefined statement1
[Else statement2]
tests whether the target person is not defined. If not defined, executes statement1. Otherwise, optionally, executes statement2
GetTargetPerson &t If the target is defined, the data of the avatar whose IP address has been received are stored in &t. This includes the IP address, which you can then retrieve with GetAddress $a &t.


backIndex