12/02/2013, 12:38
Peut être que le script suivant t'aidera:
tcl
set schan(jeuxfr.quizz) "quizz"
set schan(jeuxfr.motus) "motus"
set schan(jeuxfr.village) "village"
set template "/home/user/template.html"
set sfile "/home/user/%fname.count.html"
foreach chan [array names $schan] {
bind join - "#$chan *" statcount
bind part - "#$chan *" statpart
}
proc statpart { nick uhost handle chan {msg ""} } {
statcount $nick $uhost $handle $chan
return 0;
}
proc statcount { nick uhost handle chan } {
set fi [open $::template r]
set lines [read -nonewline $fi]
close $fi
set tot [llength [chanlist $chan]]
regsub -all -- NB_USERS $lines $tot lines
regsub -all %fname $::sfile $::schan([string range $chan 1 end]) cfile
set fo [open $cfile w]
puts $fo $lines
close $fo
return 0
}

