AvatarAdd is caused when an avatar enters the bot's perception field.
AvatarChange is caused when an avatar changes position, yaw, gesture or avatar number. Special cases: citizen number or IP address received for the avatar.
AvatarDelete is triggered when an avatar leaves the bot's perception field, except if the bot teleports out of the world.
Installer: OnAvatarAddEvent <eventlabel>
Event type: 200
Installer: OnAvatarChangeEvent <eventlabel>
Event type: 300, changed position, gesture or avatar number
Event type: 301, citizen number received
Event type: 302, IP address received
Installer: OnAvatarDeleteEvent <eventlabel>
Event type: 400
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. |
GetAvatarName $a | The name of the avatar causing this event is stored in $a |
GetAvatarSession %a | The session number of the avatar causing this event is stored in %a |
GetAvatarPerson &p | The data of the avatar causing this event are stored in &p. This includes name and session number. |
A greeter bot example... (see also Person variables and operations).
[Head] Type=Script Version=2.0 [Settings] Origin=0.000n 0.000w 0.00a 0.0° [Script] OnAvatarAddEvent AvAdd Label MainLoop Goto MainLoop End Event AvAdd GetAvatarPerson &p IfPerson &p IsGreeted EndEvent GetName $n &p SayConcat $n ", pleased to meet you!" Greeted &p EndEvent |