backIndex

Xelagot action script

Person variables and operations. Bots

Person variables are complex specialised location variables. They share all IfLoc statements with location and object variables, see Conditional Statements for Location in Location variables and operations, and practically all Location operations (same page, further up). Many of those operations are shown here, but some are not.

The following operations apply to Person variables and to bots. Some operations, which also apply to other variable types, are show here for the sake of completeness. To change the position or angle of your bot, see Motion: Warp... and the other Motion pages.

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.

&a = &b
simple assignement of all values of &b to &a.
GetBotNumber %a
GetBotNumber %a %n
gets the bot's number in the application and stores it in %a. If %n is specified, it gets the number of bot number %n; this allows you to check whether %n is out of range or not: if %a gets assigned the same number as %n, %n is not out of range. Bots are numbered from 1 upwards, numbers out of range default to the bot running the script. For X1 xelagots, valid numbers are: 1, 2 and 3.
GetPerson &a
GetPerson &a %n
assigns to person variable &a the data of the bot running the script. If %n is specified, it gets the data of bot number %n. Bots are numbered from 1 upwards, numbers out of range default to the bot running the script. For X1 xelagots, valid numbers are: 1, 2 and 3. Note: if you extract the name of the bot from here e.g. with GetName $n &a, it will contain square brackets.
GetPerson &a &b
assigns to person variable &a the data of person variable &b.
GetName $a
GetName $a %n
assigns to $a a string containing the bot's name (without square brackets). If %n is specified, extracts the name of bot number %n. Bots are numbered from 1 upwards, numbers out of range default to the bot running the script. For X1 xelagots, valid numbers are: 1, 2 and 3.
GetName $a &b assigns to $a a string containing the name stored in person variable &b. Names of tourists include the quotes, names of bots include the square brackets. The reverse, GetName &b $a, does not exist: you can not 'create' a person in this way.
Since practically all operations on location variables apply to person variables too, consult the page on Location variables and operations as well as this one, not all operations are shown here.
GetLocation $a
GetLocation $a %n
GetLocation @a
GetLocation @a %n
GetLocation &a
GetLocation &a %n
GetLocation ~a
GetLocation ~a %n
assigns to string variable $a, location variable @a, person variable &a or object variable ~a the coordinates and the world of the bot. If %n is specified, it gets the location of bot number %n. Bots are numbered from 1 upwards, numbers out of range default to the bot running the script. For X1 xelagots, valid numbers are: 1, 2 and 3.
GetLocation $a &b
GetLocation @a &b
GetLocation &a &b
GetLocation ~a &b

GetLocation $a @b
GetLocation @a @b
GetLocation &a @b
GetLocation ~a @b

GetLocation $a ~b
GetLocation @a ~b
GetLocation &a ~b
GetLocation ~a ~b

GetLocation $a $b
GetLocation @a $b
GetLocation &a $b
GetLocation ~a $b
assigns to string variable $a, location variable @a, person variable &a or object variable ~a the coordinates and the world stored in person variable &b, location variable @b, object variable ~b or string (variable or literal) $b. GetLocation $a $b means that $b has a location coordinate and world, this is copied to $a and the notation is standardised.
Notice here the full compatibility between variables of the location family: location, person and object.
GetPosition $a
GetPosition $a %n
GetPosition @a
GetPosition @a %n
GetPosition &a
GetPosition &a %n
GetPosition ~a
GetPosition ~a %n
assigns to string variable $a, location variable @a, person variable &a or object variable ~a the coordinates of the bot. If %n is specified, it gets the coordinates of bot number %n. Bots are numbered from 1 upwards, numbers out of range default to the bot running the script. For X1 xelagots, valid numbers are: 1, 2 and 3.
GetPosition $a &b
GetPosition @a &b
GetPosition &a &b
GetPosition ~a &b

GetPosition $a @b
GetPosition @a @b
GetPosition &a @b
GetPosition ~a @b

GetPosition $a ~b
GetPosition @a ~b
GetPosition &a ~b
GetPosition ~a ~b

GetPosition $a $b
GetPosition @a $b
GetPosition &a $b
GetPosition ~a $b
assigns to string variable $a, location variable @a, person variable &a or object variable ~a the location values (without modifying the world) in person variable &b, location variable @b, object variable ~b or string (variable or literal) $b. GetPosition $a $b means that $b has a location coordinate, this is copied to $a, the world is removed and the notation ie standardised.
Notice here the full compatibility between variables of the location family: location, person and object.
GetNS %a
GetNS %a %n
gets the bot's NS coordinate (in metres). If %n is specified, it gets the NS coordinate of bot number %n. Bots are numbered from 1 upwards, numbers out of range default to the bot running the script. For X1 xelagots, valid numbers are: 1, 2 and 3.
GetNS %a &b
GetNS &a &b
GetNS @a &b
GetNS ~a &b

GetNS %a @b
GetNS &a @b
GetNS @a @b
GetNS ~a @b

GetNS %a ~b
GetNS &a ~b
GetNS @a ~b
GetNS ~a ~b

GetNS &a %b
GetNS @a %b
GetNS ~a %b
gets the NS coordinate stored in person variable &b, location variable @b, in person variable &b or in numeric variable %b (in metres, see CAREFULL) and stores it in numeric variable %a (in metres), person variable &a or object variable ~a. CAREFULL: GetNS %a %b has a different meaning, see GetNS %a %n
Notice here the full compatibility between variables of the location family: location, person and object.
GetWE %a
GetWE %a %n
gets the bot's WE coordinate (in metres). If %n is specified, it gets the WE coordinate of bot number %n. Bots are numbered from 1 upwards, numbers out of range default to the bot running the script. For X1 xelagots, valid numbers are: 1, 2 and 3.
GetWE %a &b
GetWE &a &b
GetWE @a &b
GetWE ~a &b

GetWE %a @b
GetWE &a @b
GetWE @a @b
GetWE ~a @b

GetWE %a ~b
GetWE &a ~b
GetWE @a ~b
GetWE ~a ~b

GetWE &a %b
GetWE @a %b
GetWE ~a %b
gets the WE coordinate stored in person variable &b, location variable @b, in person variable &b or in numeric variable %b (in metres, see CAREFULL) and stores it in numeric variable %a (in metres), person variable &a or object variable ~a. CAREFULL: GetWE %a %b has a different meaning, see GetWE %a %n
Notice here the full compatibility between variables of the location family: location, person and object.
GetAltitude %a
GetAltitude %a %n
gets the bot's Altitude (in metres). If %n is specified, it gets the Altitude of bot number %n. Bots are numbered from 1 upwards, numbers out of range default to the bot running the script. For X1 xelagots, valid numbers are: 1, 2 and 3.
GetAltitude %a &b
GetAltitude &a &b
GetAltitude @a &b
GetAltitude ~a &b

GetAltitude %a @b
GetAltitude &a @b
GetAltitude @a @b
GetAltitude ~a @b

GetAltitude %a ~b
GetAltitude &a ~b
GetAltitude @a ~b
GetAltitude ~a ~b

GetAltitude &a %b
GetAltitude @a %b
GetAltitude ~a %b
gets the Altitude stored in person variable &b, location variable @b, in person variable &b or in numeric variable %b (in metres, see CAREFULL) and stores it in numeric variable %a (in metres), person variable &a or object variable ~a. CAREFULL: GetAltitude %a %b has a different meaning, see GetAltitude %a %n
Notice here the full compatibility between variables of the location family: location, person and object.
GetRotation
see GetYaw, its new Xelagot 3.3 name. The older GetRotation statements still work in newer bots.
3.3 statements

GetYaw %a
GetYaw %a %n

similarly: GetTilt (or 3.4 GetPitch), GetRoll
 
gets the bot's present Yaw, assigns it to %a. If %n is specified, it gets the Yaw of bot number %n. Bots are numbered from 1 upwards, numbers out of range default to the bot running the script. For X1 xelagots, valid numbers are: 1, 2 and 3.
3.3 statements

GetYaw @a @b
@a may be substituted by &a and ~a,
@b may be substituted by &b and ~b.

GetYaw @a %b
@a may be substituted by &a and ~a.

GetYaw %a @b
@b may be substituted by &b and ~b.

new in 3.3
GetYaw @a $b
@a may be substituted by &a and ~a.

similarly: GetTilt (or 3.4 GetPitch), GetRoll
 
gets the Yaw in @b, &b, ~b, or the value in degrees in variable or literal %b (in 3.3: or extracts the Yaw value from a location string $b), and assigns it to @a or %a. Numerical variables or literals are in degrees. Does not modify other values of @a (or &a, ~a).

Similarly for Tilt and Roll.

 

GetCellNS %a
GetCellNS %a %n
gets the bot's cellNS (CellZ) coordinate (in integer decametres). If %n is specified, it gets the cellNS of bot number %n. Bots are numbered from 1 upwards, numbers out of range default to the bot running the script. For X1 xelagots, valid numbers are: 1, 2 and 3.
GetCellNS %a @b
GetCellNS %a &b
GetCellNS %a ~b
gets the CellNS (CellZ) coordinate (in integer decametres) stored in location variable @b, in person variable &b or in object variable ~b.
GetCellWE %a
GetCellWE %a %n
gets the bot's cellWE (CellX) coordinate (in integer decametres). If %n is specified, it gets the cellWE of bot number %n. Bots are numbered from 1 upwards, numbers out of range default to the bot running the script. For X1 xelagots, valid numbers are: 1, 2 and 3.
GetCellWE %a @b
GetCellWE %a &b
GetCellWE %a ~b
gets the CellWE (CellX) coordinate (in integer decametres) stored in location variable @b, in person variable &b or in object variable ~b.
GetWorld $a
GetWorld @a
GetWorld &a
GetWorld ~a

GetWorld $a %n
GetWorld @a %n
GetWorld &a %n
GetWorld ~a %n
gets the bot's present world, assigns it to $a, @a, &a or ~a. If %n is specified, it gets the world of bot number %n. Bots are numbered from 1 upwards, numbers out of range default to the bot running the script. For X1 xelagots, valid numbers are: 1, 2 and 3. Does not modify other values of @a, &a or ~a.
GetWorld $a &b
GetWorld &a &b
GetWorld @a &b
GetWorld ~a &b

GetWorld $a @b
GetWorld &a @b
GetWorld @a @b
GetWorld ~a @b

GetWorld $a ~b
GetWorld &a ~b
GetWorld @a ~b
GetWorld ~a ~b

GetWorld &a $b
GetWorld @a $b
GetWorld ~a $b

assigns to string variable $a, person variable &a, location variable @a or object variable ~a the world of person variable &b, location variable @b, object variable ~b or string (variable or literal) $b. CAREFULL: GetWorld $a $b does not exist
Notice here the full compatibility between variables of the location family: location, person and object.
GetUniverse $a
GetUniverse $a %n
assigns to $a a string containing the universe the bot is in. If %n is specified, it gets the universe of bot number %n. Bots are numbered from 1 upwards, numbers out of range default to the bot running the script. For X1 xelagots, valid numbers are: 1, 2 and 3.
GetUniverse $a &b
assigns to string variable $a the universe name of person variable &b. The reverse operation GetUniverse &p $a does not exist.
GetSession %a
GetSession %a %n
gets the bot's session number and stores it in %a. If %n is specified, it gets the session number of bot number %n. Bots are numbered from 1 upwards, numbers out of range default to the bot running the script. For X1 xelagots, valid numbers are: 1, 2 and 3.
GetSession %a &b
assigns to variable %a the session number of person variable &b. The reverse operation GetSession &b %a does not exist.
GetCitnum %a
GetCitnum %a %n
gets the bot's citizen login number and stores it in %a. If %n is specified, it gets the citizen number of bot number %n. Bots are numbered from 1 upwards, numbers out of range default to the bot running the script. For X1 xelagots, valid numbers are: 1, 2 and 3.
GetCitnum %a &b
GetCitnum ~a &b
GetCitnum ~a %b
assigns to variable %a or ~a the citizen number of person variable &b (or to ~a the citizen number stored in %b). If is not known or is not a citizen, this number will be 0 or less. The reverse operation GetCitnum &b %a does not exist.
GetPrivs %a &b (3.1 world server 28 or up) gets the privs used by person &b and stores it in %a. Privs are = 0 if they are unknown, =Citnum if they are known and the person uses no privs or uses his/her own, any other positive number indicates the citizen number of the privs used by the person. Privs are not yet available, expected in AW version 3.1 The reverse operation GetPrivs &b %a does not exist.
GetVersion %a &b (3.1, world server 28 or up) if available, gets the version of the browser (people) or the sdk (bots) used by person &b and stores it in %a. The reverse operation GetVersion &b %a does not exist.
GetID $a &b
assigns to variable $a the program's personal-ID code of person variable &b. The reverse operation GetID &b $a does not exist.
GetAddress $a &b
GetAddress &a &b
assigns to variable $a or &a the IP address stored in variable &b. The reverse operation GetAddress &b $a does not exist.
GetHost $a &b
GetHost &a &b
version 3.421
assigns to variable $a or &a the Host name of the IP address stored in variable &b. The reverse operation GetHost &b $a does not exist.
GetHosts $a &b
GetHosts /s_myList &b
GetHosts &a &b
version 3.421
assigns to variable /s_myList or $a or &a the Host names of the IP address stored in variable &b. In the case of string variable $a the list is comma separated.The reverse operation GetHosts &b $a does not exist.
GetAvatar %a
GetAvatar %a %n
gets the bot's avatar number and stores it in %a. If %n is specified, it gets the avatar number of bot number %n. Bots are numbered from 1 upwards, numbers out of range default to the bot running the script. For X1 xelagots, valid numbers are: 1, 2 and 3.
GetAvatar %a &b
assigns to variable %a the avatar number of person variable &b. The reverse operation GetAvatar &b %a does not exist.
GetGesture %a
GetGesture %a %n
gets the bot's current gesture number and stores it in %a. If %n is specified, it gets the gesture number of bot number %n. Bots are numbered from 1 upwards, numbers out of range default to the bot running the script. For X1 xelagots, valid numbers are: 1, 2 and 3.
GetGesture %a &b
assigns to variable %a the gesture number of person variable &b. The reverse operation GetGesture &b %a does not exist.
IdentifyCitizen &a
Searches the whole database of avatars for the citizen number (uses the session number as guide). If found there, returns that number inmediately in the person variable. If not found there, queries the universe server, and triggers the events CitizenAttributes and AvatarChange if it has been installed.

Universe owner bots (citizen 1) only: as from xelagots 3.411, this command always queries the universe server and triggers the events CitizenAttributes and AvatarChange if it has been installed. In the event CitizenAttributes, the statement
GetChatline $a
or the equivalent statement
GetMessage $a
retrieves the comment line of the universe database for this citizen.
Identify &a
(as from X1 version 2.9999957) Similar to IdentifyCitizen, with a few differences. Searches the whole database of avatars for the citizen number and IP number (uses the session number as guide). If found there, returns those numbers inmediately in the person variable. If not found there, queries the universe server and (if the bot has Eject rights) the world server, and triggers the events CitizenAttributes and Address and AvatarChange if it has been installed. See also Identify ON/OFF.
Greeted &a
Use after greeting avatar &a, if you wish to test later IfPerson &a IsGreeted (see Conditional statements), to avoid repeating greetings.
The following statements are used in event handlers (see the corresponding event handler for details):
GetChatPerson &a
used in the following event handlers: Chat, BotMessage, BotChat.
assigns to person variable &a all the values of the speaker.
GetChatLine $a
used in the following event handlers: Chat, BotMessage, BotChat; CLMessage, DBMessage, UIChat, BotHear, CLHear, DBHear, BotAnswer, CLAnswer.
assigns to string variable $a the chatline.
GetChatName $a
used in the following event handlers: Chat, BotMessage, BotChat; CLMessage, DBMessage, UIChat, BotHear, CLHear, DBHear, BotAnswer, CLAnswer.
assigns to string variable $a the speaker's name.
GetChatSession %a
used in the following event handlers: Chat, BotMessage, BotChat.
assigns to numeric variable %a the speaker's session number.
GetAvatarPerson &a
used in the following event handlers: AvatarAdd, AvatarChange, AvatarDelete, AvatarScan.
assigns to person variable &a all the values of the avatar causing the event.
GetAvatarName $a
used in the following event handlers: AvatarAdd, AvatarChange, AvatarDelete, AvatarScan.
assigns to string variable $a the name of the avatar causing the event.
GetAvatarSession %a
used in the following event handlers: AvatarAdd, AvatarChange, AvatarDelete, AvatarScan.
assigns to numeric variable %a the session number of the avatar causing the event.
GetSourcePerson &s used in the following event handlers: AvatarClick, ObjectClick, ObjectSelect, ObjectAdd, ObjectDelete.
Assigns to person variable &s the data of the avatar causing the event.
GetSourceName $s used in the following event handlers: AvatarClick, ObjectClick, ObjectSelect, ObjectAdd, ObjectDelete.
Assignes to string variable $s the name of the avatar causing the event.
GetSourceSession %s used in the following event handlers: AvatarClick, ObjectClick, ObjectSelect, ObjectAdd, ObjectDelete.
Assignes to numeric variable %s the session number of the avatar causing the event.
GetTargetPerson &t used in the following event handlers: AvatarClick, TextComplete, CitizenAttributes, Address.
Assigns to person variable &t the data of avatar targeted by the event.
GetTargetName $t used in the following event handlers: AvatarClick, TextComplete.
Assigns to string variable $t the name of avatar targeted by the event.
GetTargetSession %t used in the following event handlers: AvatarClick, TextComplete.
Assigns to numeric variable %t the session number of avatar targeted by the event.
GetNameSessionAddress $n %s $a used in the following event handlers: CitizenAttributes, Address.
GetEventResult is 0 (no error) retrieves the data of the query, but does not tell whether the avatar is present or not.
GetTargetObject ~t used in the following event handlers: ObjectClick, ObjectSelect, ObjectCreate, ObjectResult.
Stores in ~t the data of the object clicked, selected, created or deleted. When an object is modified, stores the new object.
GetTargetObject2 ~t used in the following event handlers: ObjectCreate, ObjectResult.
Stores in ~t the adata of the object which will get or has been modified (the old object).
GetSourceTarget &s &t used in the following event handlers: AvatarClick.
Assigns to &s the data of the avatar causing the event, and to &t the data of the avatar targeted (clicked)
GetSourceTarget &s ~t used in the following event handlers: ObjectClick, ObjectSelect, ObjectAdd, ObjectDelete.
Assigns to &s the data of the avatar causing the event, and to ~t the data of the object.
See sections: Numeric variables and operations, String variables and operations, Location variables and operations

CONDITIONAL STATEMENTS FOR PERSONS AND BOTS

See Conditional Statements for a general explanation, and Conditional Statements for Location in Location variables and operations, which all apply to person variables.

Conditional statements for person. These conditional statements check the bot's database. They only work for avatars the bot has detected and kept in its database. An avatar remains in the database till one hour after its departure (this may vary from version to version). See also the conditional statements for location, which apply equally to person variables. As in all conditionals, the Else line is optional.
IfPerson &a operator statement1
Else statement2
recommended. In all other IfPersonXXX below, the bot tries to retrieve the person pointed to by XXX = Name, Session or Citnum from it database.
IfPersonName $a operator statement1
Else statement2
not recommended
IfPersonSession %a operator statement1
Else statement2
not recommended
IfPersonCitnum %a operator statement1
Else statement2
not recommended
The operator may be one of the following:
IsPresent
IsNotPresent
IsAbsent
checks the bot's database for the presence or absence of an avatar
IsGreeted
IsNotGreeted
checks the bot's database to see if the avatar was greeted
IsAnnouncedConMsg
IsNotAnnouncedConMsg
checks the bot's database to see if the avatar was sent a console message world announce
IsBoss
IsNotBoss
checks if avatar is boss
IsBoss1
IsNotBoss1
checks for first ownership
IsBoss2
IsNotBoss2
checks for second ownership
IsFollowed
IsNotFollowed
checks if avatar is being followed by bot
IsWatched
IsNotWatched
checks if avatar is being watched (looked at or avoided) by bot
IsCitizen
IsNotCitizen
checks if avatar is a citizen
IsTourist
IsNotTourist
checks if avatar is a tourist
IsBot
IsNotBot
checks if avatar is a bot
IsXelagot
IsNotXelagot
checks if avatar is a xelagot
IsIdentified
IsNotIdentified
checks, in the case of Citizens and Bots, if avatar's citizen number has been identified. In other cases (tourist, bots), IsIdentified is always true, IsNotIdentified always false.
IsCitizenIdentified
IsNotCitizenIdentified
checks, in the case of Citizens, if avatar's citizen number has been identified. In other cases (tourist, bot), IsCitizenIdentified is always true, IsNotCitizenIdentified always false.
IsCitizenUnidentified
IsNotCitizenUnidentified
checks, in the case of Citizens, if avatar's citizen number has not been identified. In other cases, IsCitizenUnidentified is always true, IsNotCitizenUnidentified always false.
HasCaretaker checks for Caretaker right for the citizen number. Only works at present for the citizen number of the bot itself, because the bot can only know if it's citizen number is caretaker or nor, it can not know this of other citizen numbers.
# for the bot
GetPerson &b
IfPerson &b HasCaretaker Gosub Do_Something
   
HasEminentDomain
HasEject
HasPublicSpeaker
HasSpecialObjects
HasSpecialCommands
HasBuild
HasBots
HasEnter
HasSpeak
checks for rights of the citizen number (not of the privs), as listed in the World options. Requires prior identification of citizen number. See next entry for checking privs in 3.1 worlds.
# for the bot
GetPerson &b
IfPerson &b HasEject Gosub Do_This

# for persons
IfPerson &p HasPublicSpeaker Gosub Do_Something

   
WearsCaretaker x1 2.9999975, av99 2.8, requires 3.1 world build 28 or higher. Checks if the person is wearing Caretaker privs. Only works at present for people wearing privs equal to the citizen number of the bot itself, if the bot is Caretaker.
# for the bot
GetPerson &b
IfPerson &b WearsCaretaker Gosub Do_Something
   
WearsEminentDomain
WearsEject
WearsPublicSpeaker
WearsSpecialObjects
WearsSpecialCommands
WearsBuild
WearsBots
WearsEnter
WearsSpeak
x1 2.9999975, av99 2.8, requires 3.1 world build 28 or higher. Checks for rights of the privs worn by the person, as listed in the World options. If the person is not wearing privs, checks the citizen number.
# for the bot
GetPerson &b
IfPerson &b WearsEject Gosub Do_This

# for persons
IfPerson &p WearsPublicSpeaker Gosub Do_Something


   
IsWalking
IsRunning
IsFlying
IsSwimming
IsFalling
IsJumping
IsWarping
version 3.410
These are the so called avatar states. Both the world and person's browser must have 3.4 abilities (otherwise IsWalking is always true). Bots can issue 'I am flying' or other states at will, browsers send the correct state.
 
Setting Bot avatar states
AvatarState Walking
AvatarState Running
AvatarState Flying
AvatarState Swimming
AvatarState Falling
AvatarState Jumping
AvatarState Warping
or
AvatarState $a
version 3.410
Changes the avatar state of the bot in a 3.4 compatible world. The word 'running' etc. can be in a string variable.
Bot conditionals
IfGetBot &bot $botname statement1
Else statement2

IfGetBot &bot %number statement1
Else statement2
retrieves the bot data as a person variable if $botname (square brackets are disregarded) or %number (1 to maximum bots in program) of a bot in the program are known. If it is successful, it executes statement1. An Else clause may follow.
IfBotExists $botname statement1
Else statement2

IfBotExists &bot statement1
Else statement2
executes statement1 if the $botname or the name contained in the person variable correspond to a bot in the program. Square brackets are disregarded. An Else clause may follow.
Other conditionals
IfGetPresentName &a $n statement1
Else statement2
Searches the database of avatars present. If found, recovers the first occurrence of the name $n, stores the data in &a and executes statement1. If not found, executes statement2 if an else clause is present. The Else line is optional.
IfGetPresentSession &a %s statement1
Else statement2
Searches the database of avatars present for a session number %s. If found, stores the data in &a and executes statement1. If not found, executes statement2 if an else clause is present. The Else line is optional.
IfGetPresentCitnum &a %c statement1
Else statement2
(X1 2.9999973) Searches the database of avatars present for a citizen number %c (only for citizens, if they are identified, bots and tourists are not found this way). If found, stores the data in &a and executes statement1. If not found, executes statement2 if an else clause is present. The Else line is optional.


backIndex