   ____ _   _    _  _____    _        _
  / ___| | | |  / \|_   _|__| |_ __ _| |_ ___
 | |   | |_| | / _ \ | |/ __| __/ _` | __/ __|
 | |___|  _  |/ ___ \| |\__ \ || (_| | |_\__ \
  \____|_| |_/_/   \_\_||___/\__\__,_|\__|___/
              3.1.2 by Baerchen, February 2002
                  for eggdrop 1.4.5+ & TCL 8.3
                     baerchen@germany-chat.net
       latest versions @ home.dal.net/baerchen

See HISTORY (below) for fixes, changes and additions

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

CHATstats gathers a bunch of info about a channel and creates
statistics. Before wading through this doc, get an impression
at http://www.germany-chat.net -> Bettenauslastung (don't worry, it's
in english ;-) and see what 50% of this script make up. Or download
home.dal.net/baerchen/CHATstatsExampleOutput.zip

At a glance it ..

- collects a lot of information about a channel and its users
- creates individual and general statistics for channel and users,
  both short term and long term.
- creates rankings for "rank-able" information like spoken words etc
- dumps all of the above to IRC and/or to webpages
- can upload webpages to an FTP server or move them locally
- allows individual design of webpages by usage of templates
- is a true multichannel script through unique configuration technique
- has powerful commands for manipulation and administration purposes
- is highly configurable
- is no fire & forget script. You _will_ need a lot of time to fully
  configure and understand the script. You will spend even more time
  if you decide to make your own templates. You have been warned.

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

PUB, -|-
--------
show <..>              Shitload of options what stats to show:
                       Amount of joins, idle time, online time,
                       active chatting time, wordcount, line count,
                       kicks, bans, etc. Too much to list here, so
                       see the help file.

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 TopTalkers to Allstars
freeze <nick>          Freezes <nick>'s account
unfreeze <nick>        Unfreezes <nick>'s account

DCC, -|-
---------
(only available if helpfile is installed)
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>
chatstats              Shows some important configuration info

DCC, n|-
--------
update ?channel?       Bypasses timer to create webpages immediately
trim ?channel? <limit> Trims the database manually if necessary
wipechan <channel>     Deletes a channel from the database
back-up                Makes a backup of the .dat file
recover                Reads the .backup file to memory

For detailled info, install the supplied chatstats.help.

THANKS
*********************************************************************

- freiburger for being my TCL tutor and lots of other things
- stdarg for helping me with regular expressions
- Wcc for his great botnet-map proc
- All users for submitting bugs, comments and ideas
  
HISTORY
*********************************************************************
3.1.2
Fixed: Array csz introduced with 3.1.1 was not properly unset after
       creation of webpages. Didn't hurt though
Fixed: Words spoken in the channel got assigned to wrong time ranges
       in the activity stats if cs(timebalance) was different from
       +0.
Fixed: In the current channel stats, users' idle time was always 
       shown as 0. Didn't affect the idle-times for the other stats
       though.
Changed: Updated documentation and helpfile. CHATstats is not
         compatible with eggdrop 1.4.x as stated, but with 1.4.5+
Changed: Removed sanity check for existing workdir
Changed: Removed database upgrade support from v2.x
Added: Two new placeholders for the templates:
       %%CHANPEAKVALUE   returns channel peak
       %%CHANPEAKDATE    returns the date of %%CHANPEAKVALUE
Added: Another way to check for shell's ftp client
Added: TCL version check and proper internal versioning

3.1.1
Fixed: Another "&" issue: In 3.1.0 I fixed it, but only for one
       occurence of & in a topic or channelname. Two or more
       occurences made the webpage creation procedure cause an error.
       Same for "%%".
Fixed: List processing problem in cs:html - changed the way the
       templates are parsed from list to string processing.
Fixed: Glitch introduced in 3.1.0: in 'show stats', TopTalker's rank
       was always 0
Changed: Permissions for command 'chatstats' from n|- to nC|C.
Changed: Duration of online-time and idle-time in '.show' is now
         shown the same way as on the webpages.
Changed: Minor things, such as wording, grammar, bla.
Added: PUB Commands 'freeze'/'unfreeze' make CHATstats temporarily
       ignore/unignore a user
Added: Per-channel-listing of all frozen accounts to command
       'chatstats'
Added: Botnet map (similar to '.bottree') to botstats.global.template
       Some of you might think there's redundant information now, but
       it's ok for demonstration purposes. Remember, you can change
       the templates as you like. Thanks to Wcc for idea and code.
       Used with friendly permission.
Added: Variable 'rankrange': until now, 'show <whatever>' returned
       the first ten ranks of each category. With 'rankrange' you
       can determine individually how many ranks are returned
Added: In 3.1.0, I've added the new listing 'topactiveusers' for
       the webpages. Consequently, I had to add the option
       'actives' to the 'show' command

3.1.0
- Introduced new listing for templates: topactiveusers, which returns
  users' onlinetime minus idletime, sorted. %%TOTALACTIVE returns
  the total active chatting time of all users.
- Introduced variable cs(dont): a space delimited list of words,
  which when spoken, prevents CHATstats from counting.
  highly recommended.
- Three variables weren't available although built-in (TOTALWORDS & 
  TOTALLINES & TOTALRATIO).
- Added variable !!FLAGS to the chanusers listings (if user is
  recognized by bot, it returns his flags)
- .dat file was holding data of channels that weren't enabled
  (wasn't checking for enabled channels in cs:rawpart and 
  cs:rawjoin). This bug didn't affect anything except the size of
  the .dat file. After rehashing, you can .wipechan those channels.
- 'wipechan' now understands more than one argument:
  wipechan #channel1 #channel2 #channel3 ..
- cs(trim) went to the global variables. Each channel can be trimmed
  with different values
- Fixed biggie: 'cyclestats' cycled all channels. Duh.
- When script was stopped, %%TIMENEXTUPDATE still returned a value.
- Fixed %%CHANNEL returning bs when channel name contained the
  character '&', e.g. #wine&dine (same for %%CHANTOPIC). 
- Fixed 'update' - under certain circumstances it was not possible
  to add a channel and have .update generate the websites - though
  normal ("scheduled") updating worked fine.
- Fixed non-latin language based bug: if a nick used non-latin 
  characters, an error in cs:update was raised stating the nick
  can't be found on the channel. Since this has nothing to do with
  the script itself but the way eggdrop and TCL work together,
  a quick workaround was to simply exclude that nick from further
  processing.
- Updated and changed command 'chatstats' slightly.
- Updated helpfile (corrections, additions).
- Gained speed improvements in regard to array operations.
- Added sanity checks to some commands.
- Cleaned up code and improved legibility of the script.

3.0.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 settings (who cares for the names of
  the cachefiles ;-))

Changes prior to 3.0.0 on request.