backIndex

Xelagot action script

Events: Bot Client handlers

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

Version 2.9999943

Refer to Events for general information on events, Events: Chat and messages for receiving messages, and to Bot Clients and action script and Setting up a script connection for specific information on how to use a Bot Client.

CLConnect is triggered when the Bot Client connects to a remote server (Host). CLLogin occurs after CLConnect, when the Bot Client concludes the login procedure and is accepted by the remote server. CLDisconnect is triggered when the Bot Client disconnects from the remote server, either due to its own request to disconnect, or due to other factors, including being disconnected forcefully by the remote server (e.g. if the login procedure fails).
The following events can occur between CLLogin and ClDisconnect: CLHear (and CLAnswer), CLMessage is triggered when the Bot Client receives messages from a Bot Client. ClAdd events are triggered on three occasions: 1. when clients of the remote server log in; 2. after CLLogin: the remote Server sends one CLAdd event for each online client that uses the same protocol (including the Bot Client self); 3. when the script issues the statement CLListOnline. CLUnsent occurs when the script sends a message to a Login name which is not online. ClDelete occurs when clients of the remote server log off.

Note: CLConnect, CLLogin and CLDisconnect are sent by the Bot Client. CLAdd, CLMessage, CLDelete and CLUnsent are sent by the remote server (through the BotClient).

Installer: OnCLConnectEvent <eventlabel>
Event type: 10200

Installer: OnCLLoginEvent <eventlabel>
Event type: 10203

Installer: OnCLDisconnectEvent <eventlabel>
Event type: 10201

Installer: OnCLAddEvent <eventlabel>
Event type: 10204

Installer: OnCLDeleteEvent <eventlabel>
Event type: 10205

Installer: OnCLUnsentEvent <eventlabel>
Event type: 10206

Installer: OnCLMessageEvent <eventlabel>
Event type: 8120

Installer: OnCLHearEvent <eventlabel>
Event type: 8420

Installer: OnCLAnswerEvent <eventlabel>
Event type: 8430

Installer: OnCLMessageEvent <eventlabel>
Event type: 8120

Specific statements (must be inside these event handlers):

GetEventType %a stores the event type code in variable %a
GetEventResult %a stores the event result code in variable %a. 0 means success, other positive codes are equivalent to the rc codes of the SDK and the Windows codes. See SDK Error Codes.
GetEventAddress $a
GetEventHost $a
stores an IP Address and Host in $a.
GetEventLogin $n
CLMessage, CLHear and CLAnswer event handlers may use
GetChatName $n
stores the Login name in $n.
GetMessage $a
CLMessage, CLHear and CLAnswer event handlers may use
GetChatline $a
stores the text of the message sent to the Bot Client. Used mainly by event CLMessage, CLHear and CLAnswer

These parameters are not valid for all events. Here is an example of valid calls. Some handlers only indicate the event has taken place, others have more information

# the installers
OnClConnectEvent cConnect
OnClLoginEvent cLogin
OnClDisconnectEvent cDisconnect
OnClAddEvent cAdd
OnClDeleteEvent cDelete
OnClMessageEvent cMessage
OnClHearEvent cHear
OnClUnsentEvent cUnsent

# The event handlers
Event cConnect
   # your code here
EndEvent

Event cLogin
   # your code here
EndEvent

Event cDisconnect
   # your code here
EndEvent

Event cAdd
   GetEventAddress $i
   GetEventHost $h
   GetEventLogin $n
   # your code here
EndEvent

Event cDelete
   GetEventAddress $i
   GetEventHost $h
   GetEventLogin $n
   # your code here
EndEvent

Event cMessage
   GetEventLogin $n
   GetMessage $a
   # your code here
EndEvent

Event cHear
   GetEventLogin $n
   GetMessage $a
   # your code here
EndEvent

Event cUnsent
   GetEventLogin $n
   GetMessage $a
   # your code here
EndEvent


backIndex