   ____ _   _    _  _____    _        _
  / ___| | | |  / \|_   _|__| |_ __ _| |_ ___
 | |   | |_| | / _ \ | |/ __| __/ _` | __/ __|
 | |___|  _  |/ ___ \| |\__ \ || (_| | |_\__ \
  \____|_| |_/_/   \_\_||___/\__\__,_|\__|___/
               3.0 by Baerchen, September 2001
                  for eggdrop 1.4.x+ & TCL 8.3
                     baerchen@germany-chat.net

DESCRIPTION
*********************************************************************

With some major improvments and additions, this is probably the best
version of CHATstats so far. The script gathers a bunch of info about
a channel and creates some sort of statistics. In detail it monitors:

- amount of joins
- words and lines users speak
- user's online times
- user's idle times
- amount of bans (active/passive)
- amount of kicks (active/passive)
- channel peaks and peak times

The script then creates overall stats and rankings for each of the
data, e.g.

'Personal stats for baerchen on #germany-chat 
Joins: 30   Time spent: 22h:25m    Idle: 20h:23m   -> Active chatting: 2h:2m
TopTalkers: Rank 9 - 1949 words/146 lines (avg 13.3). Lutz_MMI is 428 words ahead
AllStars: Rank 18 - 1020 words/228 lines (avg 4.4). torkel is 217 words ahead
Kicks: 0   Bans: 1   Got kicked: 0   Got banned: 0'

and much more.

Counting user's spoken words often leads to competition among some of
them. At a point, when there seem to be no more changes on the top
of the ranking, +nC|C flagged users can do a cycle. I.e. the current
TopTalkers ranking will be reset to 0 and their wordcount shoved to
some kind of eternal ranking (AllStars).

A lot of information about the channel (topic, current users etc.)
and the bot (partyline users etc.) can be dumped to HTML files which
then can be uploaded to an FTP server (or moved locally). The
webpages created don't base on in-script HTML any longer but instead
on templates, which means you can use your own HTML code. Also, you
can decide which information goes into the webpages and which don't.
If you don't want to bother with this, use the supplied templates and
go right away.

The distinction of the configuration in global and channel-specific
settings gives CHATstats full multi-channel capabilities.

See "http://www.germany-chat.net -> Bettenauslastung" to get an idea
of how it _could_ look like (using the supplied templates).

NOTE: CHATstats' v3.0 database is incompatible with earlier versions.
      Although there is a converting script, I highly recommended to
      start from the scratch. (Read more in the INSTALLATION file).

COMMANDS
*********************************************************************

PUB, -|-
--------
.show <..>              Shitload of options what stats to show

PUB, nC|C
---------
.change <options>       Manipulates users word balances. Two options
.merge <source> <dest>  Merges two users in one
.delete <nick>          Deletes <nick>'s account for that channel
.cyclestats             Cycles the TopTalkers

DCC, -|-
---------
.help chatstats         Shows all CHATstats related commands
.help <command>         Shows help on a specific CHATstats command

DCC, C|C
--------
go <channel>            Enables CHATstats for <channel>
stop <channel>          Disables CHATstats for <channel>

DCC, n|-
--------
update                  Creates webpages immediately
chatstats               Shows the most important configuration info
trim <limit>            Trims the database manually if necessary
wipechan <channel>      Deletes a channel from the databases
back-up                 Makes a backup of the .dat file
recover                 Read the .backup file to memory

For detailled info, install the supplied chatstats.help and read :)

NOTES & TRICKS
*********************************************************************

- CHATstats ignores all 'Guest' nicks.
- Don't forget to .stop and .wipechan when the bot leaves a channel.
- Exclude other channel bots from being counted by adding them to the
  userlist.
- This is supposed to be the last version where command names and
  variable names have hanged. They'll stay constant in the next
  versions.

HISTORY
*********************************************************************
3.0 (major rewrite in order to implement new features)

- CHATstats now monitors joins, kicks, bans, online times, idle
  times, channel peaks, users' spoken words and lines. The
  distinction between TopTalkers and Allstars has been kept
- Introduced templates. Make your own HTML output
- Introduced division of configuration in global and channel-specific
  settings, giving CHATstats full multi-channel capabilities
- Added advertizing system. Make CHATstats advertize your website for
  info purposes
- Reintroduced .back-up and .recover
- Userlist for the channel-stats is now returned in mIRC-style
  (ops A-z, voices A-z, others A-z)
- URLs in topics are now hyperlinked
- Once again, changed commands and their syntax to match new features
- Once again, changed variable names for better understanding
- Took out some unneccessary variables (who cares for the names of
  the cachefiles ;-))

2.11
- Fixed bugs of two non-existing variables that occured under certain
  circumstances when updating .htm pages. Thanks to LangerT of
  langersoft.de for heavy debugging ;-)
- Fixed two other bugs regarding the creation of the AllStars page.
- Fixed bug that after .wipechan'ing a channel, it was not deleted
  from the configuration array, therefore causing .chatstatus to
  output inaccurate information.
- Fixed rare variable declaration bug in .go
- Fixed very rare bug that if the bot was on two channels of which
  names start equal but end different (e.g. #test and #test1), the
  AllStars of #test1 were mixed up. Except for this one, integrity
  of data was _not_ affected by all of the above mentioned bugs.
- Rewrote .chatstatus, now more accurate & informative. By doing so,
  the [lsort] error (see below) was eliminated.
- Minor changes to html code
- Added DCC commands for go and stop

2.1
- Fixed bug that after cycling stats, TopTalkers were not saved when
  the array was empty. If no word was spoken until a crash, rehash
  or restart occured, the Toptalkers had the same wordcount as
  before cycling
- Fixed bug in activity.htm when $timezone and $offset are not set
- Cleaned code; some speed and efficacy improvements
- Introduced cs(botlogo) and cs(timefactor). See README
- Introduced cs(interval): Changed method of updating htmls from a
  bind to a timer, which means that you can set the intervals more
  flexible (.restart is highly recommended)
- Introduced cs(trigger): you can now define the trigger character
  for the public commands (.restart is highly recommended)
- Fixed nasty bugs that occured when using TCL version < v8.3. There
  is still one error due to using an [lsort] option that has been
  implemented in 8.3. However, it's not vital to the script and
  affects .chatstatus only. I decided to live with this one ;-)

2.0
- Added DCC commands .chatstatus .wipechan and .update
- Added configuration of colors and font for HTMLs. Now you can adapt
  the appearance of the HTMLs to your liking
- Added some coloured bar.gifs
- Added started/stopped/last reset information to .topten .topstars
  and HTMLs
- Upon request, changed commands for .topten and .topstars to
  .toptalkers and .allstars (makes sense even ;-)
- Upon request, chanstats, toptalkers, botstats and activitystats
  now update simultaneously every hour
- Configuration wasn't saved in regular intervals - fixed
- Minor changes to the layout of the HTMLs (merged tables and stuff)
- Removed link to activity.htm on chanstats.htm
- Deleted .backup and .rollback. Who needs that anyway ;-)
- Cosmetic changes to the code. Changed cs(visitwebsite) to
  cs(nochaninfo) for better understanding
- Changed README. A.o., added chapter "POSSIBLE PROBLEMS" - Thanks
  to |Starman| on this one
      
1.02
- cs(allowhtml) was not stringtolower'ed - if channels were entered
  with uppercase letters, it caused the TopTalkers.htm not to show
  the wordcount.

1.01
- Trying to unbind an unexisting bind caused bot not to start.
- Limited host length in chanstats.htm to max. 50 chars in order
  not to mess up the table when using long hostnames.
- After starting, TopStars array was read too early, therefore
  causing an error. Delayed 10 secs now.

1.0
- First public release