Index
Xelagot topics
Language and chat
Xelagots respond to verbal commands, that is, commands issued during a chat session. These commands can be issued in various languages. The default setting is english, but other language sets are in the make (Spanish is available).
The language definition is kept in files in the Chat directory (folder). One file, Lang.ini, is common to all languages, and contains sections defining key expressions and words in each language.
The default language file is Dialog0.txt. This file is for the english language, and contains all verbal commands the bot will understand.
Translations
Translations of Dialog0.txt can be installed in the following way:
- find the name of the translation file. The only one officially available at the moment is for Spanish, and is called Spanish_AMD01.txt.
- in the bot menu Uni, open Dialog and Scripts
- look in the first section of the selector called Dialog. It contains a combo with a list of languages, a button load, and three buttons default, universe and world.
- click load to search for the file you need and load it.
- if the file is loaded correctly, its Title (the Title is in the [Common] section of the file) will appear in the combo list. Select it.
- then you must decide whether to hit default, universe or world.
- if you want this language file as default language, hit default
- if you want it for the universe the bot is in (the bot must be logged in to do this), hit universe
- if you want the bot to use this language only in the world the bot is in, hit world.
- close the selector by hitting done.
If you wish to customise an existing Language file to add your own version of the commands, read here below: Customising the language file.
If you are interested in making your own translation of Dialog0.txt to another language, please note the following:
- you may not change Dialog0.txt. Make first a copy of it and call it something else. You can translate the copy.
- Next, do one of two things:
- (for all versions of xelagot, not recommended from version 2.999958 for unofficial languages) add a section to Lang.ini. The section must start with the name of the language in english, surrounded by square brackets. You can copy the [English] section, paste it at the end of the file and translate it: of course, the name of the section will not be [English], it will be for example [Sweedish] if you make a sweedish translation. This Lang.ini section is used by the bot, together with the language file.
You must also edit the first part of the Lang.ini file:
[Languages]
Count=2
Language1=English
Language2=Spanish
Increase the Count by one, and add your language:
[Languages]
Count=3
Language1=English
Language2=Spanish
Language3=Sweedish
Keep a copy of this new Lang.ini: you will need add your changes to Lang.ini every time you upgrade the bot, because Lang.ini will be written over then unless it becomes an official language distributed with the bot.
- (from version 2.999958, recommended for unofficial languages) open Lang.ini, copy the [English] (or other language section) to the clipboard and close Lang.ini. Then open your new file and, at the end of the [Common] section, paste the contents of the clipboard. Change the value of the Language key in this section to an empty string (or remove the key).
[Common]
...
Language=
...
You can then translate the values of the keys you just pasted in the section.
In this way, Lang.ini will not be used at all for your new language, all the information will be in your new file.
- In your new file you translated from Dialog0.txt, change in the section [Common] the following lines
Title=English
Language=English
to (for example)
Title=Svensk
Language=Sweedish
or, if you are not using Lang.ini
Title=Svensk
Language=
The Language must be called the same as the corresponding section in Lang.ini or Lang.ini will not be used at all (leave it empty if you chose to use the second method mentioned above for version 2.999958 upwards). Title must be unique, it appears in the bot's Dialog selector when you install this new file, and it identifies your language for the bot.
If you have made a new language file and wish to include it in the standard edition of the bot, contact the author: xelag@3dee.nl.
The sections of the language files
The sections of Dialog0.txt are:
- [Head], which contains
Type=Chat
Version=1.02
- [Common], which contains a series of standard answers and two specifiers. The specifiers in Dialog0.txt are:
Title=English
Language=English
|
Title specifies the name of the language as will be used by the bot. It must be unique. No two language files may contain the same Title specification.
Language specifies the name of the section in Lang.ini to be used for key words. Language files with different Title specifications may use the same section of Lang.ini, for instance, you may have two variants of your language files, both in English. One might be the standard file Dialog0.txt, another one migh be a custom file made by you called MyDialog0.txt. In the [Head] section of both files, Language must be English, but Title must be different. For example, your file might have the following entries:
Title=MySlang
Language=English
|
As from version 2.999958, you may chose to ignore Lang.ini altogether, or partially, when making your own language files. If you wish not to use Lang.ini, you must paste in this [Common] section all the keywords found in one of the language sections of Lang.ini, for instance, all those in the [English] section. Their values in this [Common] section may be modified to reflect another language or dialect. In this case, remove the Language key from this section or give it an empty value.
If you wish to modify the value of some keywords of a section in Lang.ini, leave the value of Language pointing to the correct section in Lang.ini, and add in the [Common] section of your file only the keywords you wish to modify.
- [Login_Owner], which contains verbal commands for the first bosses (login owners)
- [Owner], which contains verbal commands all owners may give
- [Followed], has verbal commands specifically for people being followed by the bot if they are not a boss. This is to allow the target to free him/herself from the pursuing bot
- [People] contains commands allowed for non-bosses only
- [All] has commands common to all categories.
- [Any] is similar to [All], but does not require the bot to be named or to be in direct chat mode. I use it only to customise named commands, by adding {botname} to each command.
- [Define] was used in the past for the definitions, these have now their own separate file and are still present here only to allow the creation of that file if it is not found in the Chat folder.
Commands in the language files
The general structure of commands is:
cmd={command code}
arg=arguments
tag=a tag
hear=what the bot hears
say1=what the bot says in normal conditions
say0=what the bot says in case of failure
say2=some commands have more than one result, extra say lines are added
|
The minimal commands have only the cmd and hear lines, the say lines are required by most commands, tag is optional and stops repetitions, arg may be used to customise commands which require arguments, such as the warp command.
One special command code is the empty command cmd={}, which requires the hear and say1 lines. This code does nothing else than make the bot say the say1 line when it hears the hear line.
Commands use placeholders like {p}, {coords}. Each command code has specific placeholders, but there are placeholders common to all commands, including the empty command. The most frequently used common placeholders in the say line are:
- {botname} and {bot_name}
- {bot_universe}
- {bot_world}
- {bot_ns}, {bot_we}, {bot_altitude}, {bot_rotation}
- {bot_ns_long}, {bot_we_long}, {bot_altitude_long}
- {bot_avatar}, {bot_gesture}
- {bot_compass}
- {p} and {speaker_name}
- {speaker_universe}
- {speaker_world}
- {speaker_ns}, {speaker_we}, {speaker_altitude}, {speaker_rotation}
- {speaker_ns_long}, {speaker_we_long}, {speaker_altitude_long}
- {speaker_avatar}, {speaker_gesture}
- {speaker_compass}
- see below for a list of placeholders common to all say statements
You may specify in the Say line how the bot must answer: secretly through the program interface, in whisper or aloud. The 'target' variations are specific for commands involving a target avatar, like obey or join.
- {secret}
- {whisper_speaker}
- {aloud_speaker}
- {whisper_target}
- {aloud_target}
You may even split the bot's answer into sections, using
for example:
say1=That's my name, {p}!{n}{whisper_speaker}I'm not a HamBot, {p} :o)
The here line has also special placeholders:
- {botname}
- {bos} indicates "begin of sentence", must be first in the hear line
- {eos} "end of sentence", must be last in the here line
- {space} is used to ensure a space follows a word at the end of the hear line
The arg line can be explained with the following example:
cmd={do_warp}
hear=>Gardel
arg=aw 9877.4s 5415.762e 0a 350
tag=warp
say1=El dia que me quieras...
|
The {do_warp} command usually expects the speaker to specify the world and coordinates of the warp. These can also be specified in the arg line. In this example, when the bot hears: >Gardel it will say: El dia que me quieras... and warp to aw 9877.4s 5415.762e 0a 350.
Customising the language file
As from version 3.0, each language file has a series of companion files. For Dialog0.txt these are called: Dialog0_define..txt, Dialog0_hibye.txt and Dialog0_avclick.txt. Once present in your chat directory, these files may be edited by the user. Users may customise them to suit their needs, they will not be written over by new versions.
The _define file contains definitions, such as 'afk' (away from keyboard). See Verbal commands: Say, Define, Error.
This file has no sections, only a list of definitions, one in each line. The format of these definitions in the file is as in this example:
afk=Away From Keyboard
First comes the keyword, followed by an equal sign, followed by the definition. If the keyword must include an equal sign, as in the expression e=mc2, use a placeholder: {equal}, as in
e{equal}mc2=Energy = Mass x Speed Of Light Squared
The definition itself may contain any caracter, including the equal sign.
The corresponding section in the Dialog0.txt file will stay there but will only be used once, to make the separate file Dialog0_define.txt if it is absent. Do not edit that section after the new file is made.
The _hibye file has the greetings randomly used by the bot if automatic greeting is enabled. See Getting started: customize. This file has two sections, one headed by [Hi], the other by [Bye]. Within each section, you may include the random greetings. The placeholder {p} stands for the name of person greeted.
The _avclick file lists the random phrase the bot says, if avatar-click detection is on, when someone (source) clicks on someone else (target). See Verbal commands: Various commands. This file has three sections, headed by: [ClickedOnTarget] for when the target is known but is not the bot itself, [ClickedOnMe] when the target is the bot itself, [ClickedOnSomeone] when the target's name is unknown (out of reach for the bot). Placeholders are: {source_name} for the name of the one who clicked, {target_name} for the name of the one who was clicked upon.
The various sections in the dialog file may be customised without altering the file. To do so, you need to create one or more text files and name them according to the following pattern, based in this example on dialog0.txt (if you use another file, for instance, a translation, use that filename instead) and the section name:
- dialog0_LoginOwner.txt for the [Login_Owner] section
- dialog0_Owner.txt for the [Owner] section
- dialog0_Followed.txt for the [Followed] section
- dialog0_People.txt for the [People] section
- dialog0_All.txt for the [All] section
- dialog0_Any.txt for the [Any] section
In these files you put your custom commands, in the same way they would go in the dialog0.txt file. You may not add section headers like [Login_Owner] etc, the section is indicated in the file name itself. These files go in the Chat folder.
Placeholders valid in all strings which are sent to the bot to say
The bot collects information for 'talking' from various sources.
- language files
- scripts
- WriteToBot interface
- internal event handlers
All strings the bot receives to speak aloud or whisper, except for the SayText/WisperText chunks, are parsed for certain placeholders, and these are substituted for their values. These 'say' placeholders are:
- {botname}
- {universe}
- {world}
- {location}
- {avatar}
- {gesture}
- {rights}
- {owner}
- {boss}
- {boss1}
- {boss2}
- {present}
- {motion_type}
- {stalled_obey}
- {stalled_watch}
- {stalled_follow}
- {listening_type}
- {followed_name}
- {followed_id}
- {watched_name}
- {watched_id}
- {time}
- {time_is}
- {year}
- {month}
- {day}
- {weekday}
- {hour}
- {minute}
- {second}
- {application}
- {version}
- {copyright}
- {url}
- {email}
- {collection_count}
- {survey_count}
- {success_count}
- {failed_count}
- {midilist_file}
- {midi_current_index}
- {midi_current_name}
- {midi_count}
- {nothing}
- {nobody}
- {enter}
- {tab}
- {newline}
Index