                                       7th Arf Match Bot
                                       -----------------


Introduction:
-------------

  This bot is basically here to keep track of the games you play, the scores in those games and the
people who played in them.  Also to be able to show the history of all of that in a way that people
can easily and quickly see what info there is.


Bot Setup (Skip if you wont be running the bot):
------------------------------------------------

  The bot has inbuilt support for Q and L (on quakenet).  If your going to get it a Q account its
best to get it signed up before you install the script, you will be asked for the username/password
when the setup runs.  Also spend some time to setup the bot's name in the options and ident and
all that.

  Now when you first install the script you must make sure that its in a clean install of mirc,
scripts such as peace and protection or showdown pro will cause it to malfunction.

  When you have a nice clean setup, you should start the bot using the mirc.exe file.  If you did
not use the MatchBot.zip file you will need to load the script using the following command:

  /load -rs matchbot.mrc

  Make sure the matchbot.mrc file is in that mirc dir first tho :)

  When the script loads for the first time it will take you through the setup procedure:

  1) It will download the default english language file, this will take a few seconds, depending on
       your connection.
  2) It will ask you what channel you want the bot to work in.  This is the only channel it will
       respond to commands in, this should be your tribes 'private' channel.
  3) Next it will ask if this channel requires a key, leave blank to skip.
  4) Next it will ask if the bot has a q login, enter the username+password
     a) If you had a q user/pass it will ask you if u need an invite from Q to get into the channel
     b) Or perhaps from L?
  5) Next it will ask what port you wish to run the webserver on.  The webserver can be used to
       check match history/upcoming matches/signup when not in irc.
  6) It will ask you which times you want to spam the channel of the current matches.  You
       can choose any or all of the 24 hour checkboxes.  I've found a good time is 7am, 11am, 7pm
       and 11pm.  If there are no matches still unplayed, there will be no spam.
  7) Lastly it will ask you to restart the bot.  Once the bot has been restarted it should work
       without a hitch.  Just remember to keep it updated using the !update command! :)


Basic Use:
----------

  The bot has basically 5 commands that your normal person is going to use.  Basically a way to
list what matches are coming up and to set whether u can turn up to those matches. Sort of like the
thing most tribes do with a web-based system, but we found that nobody used the site all that
much, so i decided to write this.

  Now before we can tell you how to use the bot, I need to explain how the bot will talk to you.
When there are matches on the bot, it will spam you every few hours to remind you and possibly
inform people who don't know about matches that a new one has been added, etc. etc.  The spam is as
follows:

-MatchBot:#channel- ladder17: Thu 01/05 20:00 +0000 GMT :: ladder vs newbies-r-us :: Avail: 8-3-2
  :: DX[I] SH[I] Abaddon(x2)[S] :: We'll be playing on EoA

Now, if we break this down we get several sections, most obvious there is the date.  Then we have
the type of match and who its against (a ladder match vs newbies-r-us).  After that is the "avail"
list.  This list shows you how many people are available for each match.  The "Avail" word will be
coloured depending on if your available or not for that match, then u have the numbers of
availalbe-maybe-unavailable who can show up.  The colour code is as follows:

Green: Available
Orange: Maybe
Red: Unavailable
Purple: Not signed up yet

Now I've left the first bit of the notice out because this is the most complex part.  Because the
bot can handle a lot of matches (potentially thousands, though it would probably excess flood
quite a lot :p) each match has to be refered to by a "match id".  For this match the id is
"ladder17".  You can then use this make yourself available, unavailable, etc.

To make yourself availalbe simply type: !avail ladder17
To add yourself to the "maybe" list type: !maybe ladder17
To make yourself unavailable type: !unavail ladder17

If the "match id" were something else, like "scrimm3", you could use !avail scrimm3 and so on.
The match id is determined by the bot when the match is added (see more about this later).

  Be careful with this though; if you signup with 2 different nicknames they will both be on the
list and your team will think they have more players than they actually do.  Just be careful
to use the same nick all the time when using the bot :)

  The other 2 commands that most people may use regulary are !checkavail and !myavail.

  !checkavail is used to show you what people have signed up for a match, for instance:
!checkavail ladder17 or !checkavail scrimm3, this would give u a list like:

-MatchBot- scrim14 :: Available (7): Astrife HBZ Kael^ Karma soulassassin TTaM |DT|Dazed
  :: Maybe (2): uni| XiMuS :: Unavailable (1): Crevette

This shows that 7 people are available for scrim14, 2 are set to maybe and 1 to unavailable.

  !myavail is used to show you what matches you have signed up to.  For instance:

-MatchBot- Available (5): scrim9 booking16 scrim14 ladder13 scrim15 :: Maybe (0):
  :: Unavailable (0): :: Not signed up (0):

  And thats about it for the basic commands.


Adding a Match:
---------------

  Adding a match is simple, but must follow a strict format:

  !add type enemy date

  for instance:

  !add ladder ET 23/04/03 20:00

  This would add a "ladder" match (the id would be come ladderxx depending on how many matches you
already had in the bot).  It would set the enemy as ET and the date to 23/04/03 20:00.  The date
format is very important, if mIRC doesn't understand your date, or you leave bits out, the script
will either tell you its not valid or if it accepts it, it just wont work.  So you need to get this
right :)


Setting Match Info:
-------------------

  Each match has a list of info which can be changed using the !set command.  These are: type,
date, enemy, maps, info.  To change the info type: !set scrim type/date/enemy/maps/info something,
e.g. After you add a match like above you would need to set maps like this:

  !set scrimm4 maps DX[I] SandStorm[S] SH[I]

  This would set the maps for scrimm4 to DX[I] SandStorm[S] SH[I]

  You can then change any of the items: type, date, enemy, maps (again) or info.  The info tag is
just the bit stuck on the end when the bot spams you, use this to store server info or anything
else you can think of.

  You can use !unset to get rid of the info.  Same syntax as !set except no something on the end.


Setting Results for a Match:
----------------------------

  This is done via the !result command.  When you've played a match and want to store the result in
the bot (this is used for history functions and such) you do this: !result yourscore-enemyscore
and repeat this for each map, for instance:

  !result scrimm2 512-409 103-309 412-314

  This would set the result to a win (5-4), a loss (1-3) and a win (4-3), setting the overall game
to be a win.  Your score must come first and you must use hyphens (-) to seperate the scores.  Also
you must use the full score, e.g. 400 or 412, not just 4.  The bot takes scores that are within 5
points of each other as a draw (according to ladder rules, for convenienve).  For instance:

  !result scrimm2 5-4 1-3 4-3

  would result in the bot thinking that all 3 maps were a draw.

  There is no direct correlation between maps and scores, just try to make them line up :)


Deleting a Match:
-----------------

  There are 2 ways of doing this:

  1) For if you've accidentally added a match and want to permanently get rid of it; or,
  2) When you've played the match.

  In situation (1) you would use !harddel, this would permanently delete the match from the list.
An example would be:

  !harddel ladder6

  In situation (2) you would use !del, this does not delete the match from the list, it only hides
it so that you can use the info later on for history/result searches and stuff.  E.g.

  !del scrimm15


Changing Language:
------------------

  The bot is currently available in english and french.  All the commands are changed and all the
output from the bot is altered to fit the new language.

  If anyone wants to translate the language file into other languages, please feel free to drop
into #7tharf on quakenet and give me a shout, i'd be only too happy to add it to the list.

  To change the language use the !setlang commands (!deflang in french).  To set it to english
(the default) use:

  !setlang english

  To change to french use:

  !setlang french

  If you make a mistake in the name or use a language that isn't currently supported the bot will
not be affected, it just won't answer "Updated" when it attempts to dl the language.

Notes:
------

  Just a few things that I think I should make clear:

  ALL the commands can be used by anyone in the 'private' channel (see bot setup).  My reasoning
behind this is that if you cant trust somebody not to abuse the bot when your using it to organise
your team, do u really want them on your team? I know I wouldn't.

  Most of the commands if used just by themselves (e.g. "!avail" or "!checkavail") will give you a
list of the matches currently visible on the bot.

  Use !commands and !help for further information.

  When you join the 'private' channel, the matches will be spammed at u, if u part/join they will
be spammed, so if u cant be bothered to type !avail just rejoin the channel ;)