1#pisg.tcl v0.15 by HM2K - auto stats script for pisg (perl irc statistics generator)
2#based on a script by Arganan
3
4# WARNING - READ THIS
5#
6# If you use this script, PLEASE read the documentation about the "Silent"
7# option. If you get the message "an error occured: Pisg v0.67 - perl irc
8# statistics generator" in the channel, you are NOT running silent. Fix it.
9
10set pisgver "0.15"
11
12#Location of pisg execuitable perl script
13set pisgexe "/home/nf/pisg/pisg"
14
15#URL of the generated stats
16set pisgurl "http://stats.nemesisforce.com/"
17
18#channel that the stats are generated for
19set pisgchan "#nemesisforce"
20
21#Users with these flags can operate this function
22set pisgflags "nm"
23
24#How often the stats will be updated in minutes, ie: 30 - stats will be updated every 30 minutes
25set pisgtime "30"
26
27bind pub $pisgflags !stats pub:pisgcmd
28
29proc pub:pisgcmd {nick host hand chan arg} {
30	global pisgexe pisgurl pisgchan
31	append out "PRIVMSG $pisgchan :" ; if {[catch {exec $pisgexe} error]} { append out "$pisgexe an error occured: [string totitle $error]" } else { append out "Stats Updated: $pisgurl" }
32	puthelp $out
33}
34
35proc pisgcmd_timer {} {
36	global pisgexe pisgurl pisgchan pisgtime
37	append out "PRIVMSG $pisgchan :" ; if {[catch {exec $pisgexe} error]} { append out "$pisgexe an error occured: [string totitle $error]" } else { append out "Stats Updated: $pisgurl" }
38	puthelp $out
39	timer $pisgtime pisgcmd_timer
40}
41
42if {![info exists {pisgset}]} {
43  set pisgset 1
44  timer 2 pisgcmd_timer
45}
46
47putlog "pisg.tcl $pisgver loaded"
48