In May 1998, HamFon released his first TriviaBot, which has been widely used. Xelagot version 3.419 introduces a built-in Trivia Bot, inspired on HamFon's great bot. HamFon's trivia question files may be used unmodified by Xelagot.
Two types can be used:
The following is Hamfon's explanation of his Trivia file format, which works fine in Xelagot 3.419 or higher.
TriviaBot uses standard text files (.txt) for the list of questions and answers. Each line in the text file includes a category (e.g., "History"), up to five answers that can be accepted, and the text of the question.
The very first character on each line is designated the "separator" character. This character is used thru the rest of the line to separate answers and the question. Choose a character that is NOT used in any part of the question or answers. In the sample files, a forward slash is used. The 2nd thru 5th answers are optional. If you leave them out, also leave out the preceding Separator.
The format of a line is:
The following line is an example:/Sports&Leisure/Indianapolis Motor Speedway/Indianapolis/Indy//Where is Gasoline Alley?
For this example, TriviaBot will say that it has a question in the "Sports&Leisure" category, then ask "Where is Gasoline Alley?", and wait for answers. It will watch all chat lines, parsing them for any of the 3 matches. It is NOT context sensitive, that is, someone can type "It's at Indianapolis", and that will be considered as a correct answer. If an acceptable answer is given, or no answer is given, TriviaBot will display "Indianapolis Motor Speedway" as the correct answer.
(this text was extracted from HamFon's trivbot.htm, release 9.01, 4 June 2000)
The Xelagot question file is based on the Hamfon file format. The first change is that more than five answers are allowed. This applies directly to Hamfon style files.
If the first line of the file starts with these two words
the Hamfon Trivia file becomes a Xelagot Trivia file, with the following additional rules for the separator in the question part of the line:
Notice that in both file formats, the separator can be any character. In the above examples the forward slash was used. In the following example the backslash is used because the forward slash is part of the question:
\ActiveWorlds\XelaG Quality Bots\Xelagot\\What can you find at this URL: www.imatowns.com/xelagot ?
Download here a sample Trivia Question file made by HamFon.
And if you really want to get going, download a whole bunch of Trivia Question files sent to me by HamFon: they were made by him and others for his TriviaBot and may be used freely! CAUTION: some of the questions or answers in these files may not be suitable for children, please revise them first before using them.
Trivia Question files can be created and edited using the Xelagot Trivia Editor, that can be downloaded on the Links page. This is much easier than using Notepad!
The best place is somewhere in your bot's USBD (or User) folder. You could make a subfolder for your Trivia Question files.
Make sure you have Xelagot version 3.419 or higher. Open the menu Uni | Trivia.
Click the button marked load a question file, search for your file and load it.
The bot will be busy a few seconds, while it reads your question file line by line, validates the questions, and makes a database in a folder called 'Reserved'. This process is in a separate thread, so your bot will not 'freeze' while making the database. The total capacity of the database is 65535 questions. The database is never loaded to memory, only one record (question line) is loaded at a time.
Once the bot has finished making the database, you will see how many questions there are and the filename at the bottom of the Trivia screen.
You do not need to hit the button shuffle order to make the order of the questions random, the bot takes care of this when loading a question file, by creating a random reference file for the database. Note: to create a random reference file, the bot needs memory. This is = TotalNumberOfQuestions x 2 bytes. This memory is released as soon as the reference file is made. So if you have 10 thousand questions, the bot will temporarily need 20 thousand bytes of memory. Not much, the size of an average texture JPG :)
If you want, adjust the parameters in Trivia settings.
Your bot must be in a world. Hit the button play. That's all :)
The bot has its own default parameters and language strings (those are the ones shown in the sample INI file you downloaded), so unless you want to change them, you do not need to make or load a Trivia ini file. If you do use Trivia ini files, keep them together with your Trivia Question files.
You will need a Trivia ini file if you want to change the default parameters, or wish to change the language strings. The ini file must have the extension '.ini'. It is divided in sections.
The first section, [Game], contains the parameters used by the Trivia Bot.
The next sections contain the language strings. Read the comments in the sample INI file.
Hier is de nederlandse inifile versie.
It is possible to automate the loading of a Trivia Question file and of a Trivia INI file. In x1, the Trivia screen has buttons to do this. The other bots (av99bot and srvcXlgBot) need to have their bot inifile edited manually. In the corresponding bot section, you will see the following items:
Put the filename of the question file or ini file after the = sign. The filename must include the path relative to the bot's USBD (normally the 'User' folder) (i.e. the former 'Script' folder). For example:
means the file trivia01.txt is directly inside the 'User' folder, and
means that this file is in a subfolder of the 'User' folder, called 'Games'.
In all cases, the files MUST be somewhere inside the USBD folder for the bot to find them.
Please click here.
Please click here.