=========================================================
Team Trivia Bot - 10-18-2000  Version 1.0
=========================================================
Written by JQ - jq9@homail.com

FOREWORD:
     I started out looking for a team trivia addon that I could run to play against others
in our channel.  What I found available was less than appealing.  I did happen to come
across a trivia script named JoTrivia.  It was not a team trivia addon, but I did like the
fact that it was well written, and I liked the game play (You don't have to type in those
stupid characters before your answer).  I initially started out fixing only minor bugs and
annoyance that I found.  Well, not being able to just leave things alone, I ended up
rewriting most of the script and ended up with this team trivia addon.  I've also borrowed
questions from some trivia scripts that I've tried, as well as typing in a few on my own
(what a pain).  The script comes with over 2000 question, which will probably suffice for
most people.

	If you have any comments or suggestions about this addon script, feel free to email
me.  I will respond as time permits.  I've spent a good bit of time trying to work out all
the bugs, but I'm sure that there are things that I've missed.  If you come across any bugs,
please mail me with the details of the problem, so that they can be addressed.  If you wish
to help in adding additional questions to this program, simply attach a text file of
questions and answer to an email (See below for formatting of questions file).  Any
submission would be greatly appreciated. 


INSTALLATION:
     To install, extract teamtrivia.mrc and q.txt to a directory on your hard drive.  These
two files can be placed anywhere, but they both need to be in the same directory for the
addon to work.  I'd suggest the Mirc directory, or one of its subdirectories.  For this
example, it is assumed that the files are in the Mirc directory.  In one of Mirc's windows
type "/load -rs teamtrivia.mrc".  Mirc will prompt you whether you want to run
initialization commands.  Answer yes to this question.  This will set some default variables
that teamtrivia will need.


SETUP:
    Once you have loaded the script you will need to setup the bot to run in a specified
channel.  Join the channel you wish the bot to run in.  You can right click in the channel
window and select "Team trivia" from the popup menu.  This will give you a submenu of
options for the team trivia bot:

- "Enable\Disable team trivia bot" or "Initialize bot for <channel name>" will set the
active window as the channel to run in.  The "Initialize bot for <channel name>" only sets
the channel that the bot will run it.  It will not turn on the bot so that users can play. 
The "Enable team trivia bot" will set the channel that the bot will run in, and also enable
the bot, so that users can play.

- "Enable\Disable advertisements" will turn on\off advertisements that are sent to users
when they join the channel.  It will tell them whether or not he bot is running and how to
get a listing of available commands for the bot.  By default this option is disabled
(I personally find this to be annoying, but if you run a channel strictly for trivia, you
might want this turned on).

- "Scan question file" will run a scan of the question file to check for errors in
formatting.  For every 100 questions that are scanned you will get a message stating the
progress of the scan.  Errors that are found will be displayed in the channel window.

If you prefer to type in commands, the following are available to use:

- "/init <channel name> <seconds between questions>" - This will initialize the channel for
the trivia to run in and the pause in seconds between questions.  If you do not provide the
channel name or number of seconds on the command line, you will be prompted for that
information.  It is not necessary to place a # before the channel name.

- "/trivia.status" - Enables or Disables the trivia bot.  This will simply change the
settings back and forth for whether or not the bot is enabled.  This is the same as
selecting "Enable\Disable team trivia bot" from the channel popup menu.

- "/ad.status" - Enables or Disables the on join advertisements.  This will simply change
the settings back and forth for whether or not the advertisements are enabled.  This is the
same as selecting "Enable\Disable advertisements" from the channel menu.

- "/checkcorrupt" - Runs the scan on the question file for corruption.  This is the same as
selecting "Scan question file" from the channel menu.


PLAYING THE GAME:
	If you wish to run and play the game, you must run two copies of Mirc at the same
time.  One that will run the bot, and the other that you will use to play the game.  You
will have to have a nick that is different from the bot for it to recognize any commands
from you.

Commands that are available during game play:
	
- !help - sends a message of available commands
- !trivon <# of questions> - activates the trivia bot if it is not already running.  <# of
questions> defaults to 10 if not specified.
- !trivoff - turns off the trivia bot if it is running.
- !hint - displays a three letter hint to the channel.
- !repeat - will redisplay the current question.
- !join blue - join the blue team.
- !join red - join the red team.
- !teams - displays the members of each team.
- !score - displays the current team scores.
- !timer <# of seconds> - sets the number of seconds between questions.    The number of
seconds between questions defaults to 20 each time Mirc is started.

	If the team trivia bot is enabled, anyone in the channel will be able to use the
!trivon command to start a game.  Once this command has been submitted the users in the
channel will have 1 minute to join either the blue or red team, by using the !join blue or
!join red commands, before the questions start.  A message from the bot will be sent to the
users notifying them of what team they joined.  The bot will not recognize answers unless
you have joined one of the teams.  You can also switch between teams by using the join
command for the other team.

	When the question is asked, the answer will be displayed with asterisks (*) for the
corresponding letters of the answer.  Users will have 1 minute to answer the question
correctly.  Every 15 seconds, a single letter will be revealed to the channel.  The users
will also have the ability to use the !hint command to reveal 3 additional characters of the
answer.  This can only be used once for each question.  As answers are submitted, any
corresponding letters that match the correct answer will be displayed. 


ADDING QUESTIONS:
	If you are just a compulsive trivia fanatic, that goes though all the questions and
have a yearning for more, you can add to the questions that are supplied with this addon
script.  The questions that are used are stored in q.txt (That file that you need to have in
the same directory as teamtrivia.mrc).  The format of the question file is rather simple. 
The first line of the text file is the number of questions in the file.  This number must
match the number of lines of questions, or questions that you add may not ever be asked. 

	To add your questions, go to the bottom of the text file, and start adding.  The
format of the line is "<question>|<answer>".  The pipe, or |, is the delimiter that the
program uses to separate the question from the answer.

	If you add questions to this file, it is a good idea to run a scan on the question
file.  This will run a simple check on the file, to make sure that it is able to extract a
question and answer from all lines in the file.  Don't forget to update the first line of
the text file, with the correct number of questions in the file when you're done.


OTHER FILES OF INTEREST:
	There are two other text files that you will be interested in, usednums.txt and
corrupt.txt.  These can both be found in the same directory as the addon script.  These
files are generated by the addon as it runs, and there is nothing to worry about if you
don't seem them present in the directory. 

	The file usednums.txt contains a listing of lines numbers from the questions file
that have been asked.  This is done so that you won't have a question repeated until all
questions have been asked once.  The down side to this is that it can slow down the
performance of the game after a lot of questions have been asked (I've yet to see any
problem with this for the copy I am running).  If this becomes a problem, simply delete
this file, and everything should be good to go again.

	The other file is corrupt.txt.  This text file only gets written to if the program
selects a line from the question file that is not formatted correctly.  The line number of
the question as well as the question is written to this file for you to review, and correct
the problem in the question file. 
