Code: Select all
#This is a rewrite of pisg.tcl so now when people request !stats
#If it is not the $statsnick requesting it, it will just show the url and not generate the logs
#also the $statsexe setting goes to a bash script i have made to generate and upload the logs via ftp
#to the directory that you set in generate_logs
#
#irc.bsdaxis.net #BSDAxis
#Trip-Out
set statsexe "~/generate_logs"
set statsurl "http://www.bsdaxis.net/stats"
set statschan "#BSDAxis"
set statsflags "nm"
set statstime "120"
set statsnick "Trip-Out"
bind pub $statsflags !stats pub:statsgen
proc pub:statsgen {nick host hand chan arg} {
global statsurl statschan statsexe statsnick
if {$nick != $statsnick} {
putlog "$nick Requested Stats"
append out "PRIVMSG $statschan :\002Stats Available At:\002 $statsurl"
} else {
putlog "Generating Stats..."
exec $statsexe
append out "PRIVMSG $statschan :\002Stats Updated:\002 $statsurl"
putlog "Stats Updated."
}
puthelp $out
}
proc statstimer {} {
global statsexe statsurl statschan statstime
puthelp "PRIVMSG $statschan : \002Stats Updated:\002 $statsurl"
timer $statstime statstimer
}
if {![info exists {statsset}]} {
set statsset 1
timer 2 statstimer
}
putlog "pisg-new.tcl 1.0 By Trip-Out Loaded"