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 and Dutch are available).
The language definition is kept in files in the Chat directory (folder). The default language file is Dialog0.txt. This file is for the english language, and contains all verbal commands the bot will understand.
Language files can be loaded at menu Uni | Dialog, Scripts. You can select your language there, and set it as default for a world, for a universe and as general default. You can also select your language using verbal commands. The standard language files are: (english) Dialog0.txt, (spanish) Spanish_AMD01.txt, (dutch) Nederlands01.txt
WARNING FOR ADVANCED USERS
As from version 2.999959, the language system has changed. File Lang.ini is obsolete and is not used by the bot. The language code in Lang.ini has been moved to the [Common] section of the corresponding language files: (english) Dialog0.txt, (spanish) Spanish_AMD01.txt, (dutch) Nederlands01.txt. Older versions of these language files will not work properly.
If you have made your own custom language files, check the [Common] section of these new language files (xelagot version 2.999959) and add the missing code to your own files. You can do that now, the new code will be ignored until you upgrade the bot. Read the notes in "Changes in dialog0 and lang.txt" for details about the changes.
Check also the section on Customising the language file if you modified Dialog0.txt, Spanish_AMD01.txt or Nederlands01.txt (which you should not have done, but you can still save your changes to companion files).
You can download the new language files separately if you wish to update your custom files but do not wish to upgrade the bot yet: languagechanges.zip
|
You can find the old outdated language page here, just for reference.
Translations
Translations of Dialog0.txt can be installed in the following way:
- find the name of the translation file. The only ones officially available at the moment are for Spanish Spanish_AMD01.txt, and Dutch Nederlands01.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.
- In your new file you translated from Dialog0.txt, change in the section [Common] the following line
Title=English
to (for example)
Title=Svensk
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 one specifier. The specifier in Dialog0.txt is:
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.
- [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}, {speaker_thecompass}, {speaker_tothecompass}
- 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}
- as from 3.305 you may also specify a console message:
{conmsg_speaker}
{conmsg_target}
and, before the first bracket, you may insert your colour and style definitions:
255,255,0,1,0{conmsg_target}boo!
means red=255, green=255, blue=0, bold=on, italics=off, which gives a yellow bold 'boo!'. If you omit the definitions, the default is black plain.
If you wish the bot to mimic a whisper, use these without colour or style definitions:
{conmsgw_speaker}
{conmsgw_target}
the bot will use bold blue, and insert it's name. This function has a nice side-effect: if the bot is not caretaker, or the world is unable to send console messages, the message is sent as whisper instead.
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)
or, for a console message using {n}:
say1=That's my name, {p}!{n}255,255,0,1,0{conmsg_target}boo!
Note that the order in which different modes are sent to the server is (1) console message, (2) whisper, (3) say, no matter in which order you write them.
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. There are two groups of these files. One group of files is made automatically by the bot, the second group is optional. These files may be safely edited by the user, to include his/her own customised command: they will not be written over by new versions. Never alter the language files themselves, edit the companion files.
For dialog0.txt, the first group of files are:
- dialog0_Define.txt
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.
- dialog0_Hibye.txt
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.
- dialog0_Avclick.txt
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 language file: this is the second group of companion files. 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}
- {i_speak_language}
- {dice}
Index