Code: Select all
# ircstats.tcl v1.0 (2 April 2001)
# copyright © 2001 by Caramel <mmm_caramel@hotmail.com>
#
#
# This script automatically updates your
# IRCStats (© 1999-2001 Teemu Toivola http://torus.lnet.lut.fi/ircstats/ )
#
# It's still in the fledgling stage but it seems to work
#
# Auto-updates will occur at 11:50 and 23:50 (unixtime)
# or u can manually update from dcc chat (channel doesn't need to be in auto to do it manually)
# .updatestats <chan>
#
# The only thing u really have to do is modify your stats.cfg file for each
# channel and name it channel.cfg (eg #lamer.cfg) leave it in the same dir
# as the ircstats prog
#
# And give the FULL path for the .txt files in those cfg's <== MOST IMPORTANT
# ie - /home/myshell/ircstats/nickjoin.txt - not just - nickjoin.txt
#
# Set the full path to the directory that ircstat lives in
# and the path to your logfiles (note these MUST be mIRC style logs)
set path "/home/myshell/ircstats/"
set logpath "/home/myshell/logs/"
# finally the channels u want it to automatically update (set channels "#lamer #lamest")
set channels "#lamer #lamest"
# Don't edit below unless you know what you're doing.
proc do_stats {min hour day month year} {
global path logpath channels
foreach chan [string tolower ${channels}] {
if {![file exists ${path}${chan}.cfg]} {
putlog "You must set up a cfg file for $chan first! (or remove the channel from ircstats.tcl)"
return 0
}
if {![file exists ${logpath}${chan}.log]} {
putlog "I can't find the file $chan.log !"
return 0
}
putlog "Updating Stats for $chan ......"
exec ${path}ircstats_rh5x ${logpath}${chan}.log ${path}${chan}.cfg
puthelp "privmsg $chan :Stats page auto-update for $chan .. complete"
}
}
proc man_stats {handle ipx arg} {
global path logpath
set chan [lindex $arg 0]
if {![file exists ${path}${chan}.cfg]} {
putlog "You must set up a cfg file for $chan first!"
return 0
}
if {![file exists ${logpath}${chan}.log]} {
putlog "I can't find the file $chan.log !"
return 0
}
putlog "Updating Stats (forced manual)..."
exec ${path}ircstats_rh5x ${logpath}${chan}.log ${path}${chan}.cfg
puthelp "privmsg $chan :The Stats page has just been MANUALLY updated for $chan"
}
bind time - "50 05 * * *" do_stats
bind time - "50 17 * * *" do_stats
bind dcc n updatestats man_stats
putlog "Loaded ircstats.tcl v1.0 by Caramel"
return
# feel free to edit thin if u know what u are doing
# pls give me credit for the original
# if u find a bug or think of an improvment email me :-)
# Caramel <mmm_caramel@hotmail.com>
# or I am usually hanging around on the Planetarion irc servers
# (irc.planetarion.com) in #pub
I would like to have this working...

Or to make a tcl that works like a crontab to make "./ircstats configfile logfile" ?
Thanks!
