backIndex

Xelagot action script

Events: URL

Refer to Events for general information.

URL event is triggered whenever the bot receives a url sent by an authorised bot (browsers cant send urls). X1 2.9999954, Av99bot 1.69

Installer:

OnURLEvent <eventlabel>
Event type: 900

Specific statements (must be inside the event handler):

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. In the case of a disconnection, the code will be > 0, in the case of a reconnection, the code is always 0. See SDK Error Codes.
GetURL $u $t

3.5 (bot 3.501)
GetURL $u $t $p $t3d
stores the url in $u and the target window in $t.
As from version 3.501, two more parameters can be used: $p receives the POST message, $t3d receives either ON or OFF for whether this URL was sent to the 3d viewer or not. If this POST message is in standard POST format, use SListGetParams /s_List $p to convert the parameters in $p to name=value pairs in the string list.
Note: the DownloadComplete event uses the same statement with different parameters.

This very short script waits until the bot gets a URL (sent by a Caretaker), then says the URL aloud.

[Head]
Type=Script
Version=2.0

[Settings]
Origin=0.000n 0.000w 0.00a 0.0°

[Script]
  OnURLEvent GotURL
Label MainLoop
  Goto MainLoop
End

Event GotURL
  GetURL $u $t
  IfString $t <> "" SayConcat "Got url " $u " for target window " $t
  Else SayConcat "Got url " $u
EndEvent


backIndex