Description:
------------

Stats.mod generates statistics about the users. It counts the words 
that the user have spoken, the lines, actions, smileys, joins, quits,
mode changes, topic changes, nick changes, kicks and how long the
user has been on the channel.

The statistics are accessable via public commands (!top10, !stat...)
and via http. The webfiles can be generated frequently and/or
on-the-fly(livestats).



Installation:
-------------

Stats.mod will work with eggdrop1.4.x and with the current development
tree, eggdrop1.5.

The following instructions assume, ~/eggdrop1.4.2/ is the directory
where you installed your eggdrop from. (of course, other source dirs
will work as well)

put stats.mod.1.1.9.tar.gz in ~/eggdrop1.4.2/src/mod/,
and unpack it (tar xfz stats.mod.1.1.9.tar.gz). Change directory
back to ~/eggdrop1.4.2/. Type 'make', wait until compiling is done
and use 'make install' to install the bot and stats.mod.

All settings can be found in ~/eggdrop1.4.2/src/mod/stats.mod/stats.conf
I suggest to copy it to your eggdrop directory (probably ~/eggdrop/),
edit it to fit your needs and put a 'source stats.conf' at the end of
your eggdrop config file. This will execute the config file with every
restart or rehash.



Public commands:
----------------

!top10 [ordering]
  lists the top10 users in the channel
!top20 [ordering]
  same as !top10, but lists the top20 (surprise!)
!stat [user]
  shows the statistics for the user
!place [user/ordering]
  shows on which place the user is
!ttop10/!ttop20/!tstat/!tplace
  same as above, but only uses the statistics of today

All commands are also accessible via /msg.
("/msg <bot> top10 #chan", for example)



DCC commands:
-------------

.writewebstats [chans]
  writes the webfiles for all or for the specified channels.
  (m|-)
.purgestats
  deletes stats for non-existant users, empty stats and deletes expired users.
  (m|-)
.sumuser <user1> <user2>
  adds all statistics of user2 to user1 and deletes user2
  (n|-)
.resetuser <user> <channel>
  sets all statistics of user in channel to 0
  (m|-)

TCL commands:
-------------

incrstats <user> <chan> <type> <value> [set]
  increases the statistics of type <type> in <chan> for <user> by <value>.
  If <set> is 1, the stats are not increased but set to the value.

getstats <user> <chan> <type> [today]
  returns the stats of <user> in <chan> of type <type>. If <today> is 1,
  the statistics of today are returned.

livestats <port>
  starts listening for livestats connections on port <port>.
  If <port> is "off" or "0", the bot will stop listening.

resetuser <user> <channel>
  sets all statistics of user in channel to 0


Webfiles:
---------

The module can frequently generate webfiles with the top-x users of your
channel(s). You can configure, which information(words,letters,actions,...)
should be displayed. Additionally, one webfile displays the statistics
graphically.
Beside that, the statistics of today can be generated, too. This uses
much more cpu power, so turn this feature off, if you think that the
webfile generation takes too long.



Livestats:
----------

If you activate livestats, your bot will listen on a specified port for
http connections. The webfiles will then be generated on the fly. There
will also be a little channel and user list which makes it easier for
your users to browse through the several channel statistics of your bot.
  This method also uses less cpu power than the frequently written webfiles,
because only the file that is really needed is generated. The "old" method
generates about 20 webfiles per channel, if you turn all options on. Of
course, this advantage might be compensated if you have a large number of
users accessing the webstats often... but that's IMHO rather unusual.
  Use .console +1 to see access, or use the setting stats-loglevel to
change the loglevel.
  Stats.mod is now also able to log the access to a CLF logfile, so you can
use your favourite loganalyzer to generate stats of the stats access. :)

Autoadd:
-------

Stats.mod can automatically add users to your bot's usefile, so that their
statistics can be logged, too. This happens with some delay, to prevent the
userfile to be spammed with channel-hoppers. :)
Stats.mod can also automatically remove users that haven't been on any
channel for a certain time. It'll only delete users who were added by the
module and have no password set.
Both is optional, you can turn it off if you don't like it.

Other:
------

There is absolutely NO WARRANTY on this module. I do my best to make it
work properly, but if anything gets screwed up, I'm not responsible. Use
this module at your own risk.

Known problems:
---------------

Livestats currently only support #channels. Others (&channel, !channel...)
can't be accessed via livestats.
The old webfile generation can't distinguis between different channel type,
so you can write webfiles for !chan or for #chan, not both at the same time.
Both methods don't support channels with special characters, because those
characters must be encoded in the URL.

These limitations don't effect other functions of the module. You can still
use !top10,!stat,...



Feedback:
---------

Feel free to send feedback and bugreports(I hope there won't be any<g>) to
stats.mod@visions-of-fantasy.de


Thanks to:
----------

- [seCret] for teaching me plenty of things
- Johoho for various bug reports and suggestions
- dw for the idea of livestats and for many bug reports
- the eggdev team for developing eggdrop