#lusers test script #special for Sheyh #debug info from mIRC #-> irc.rea.ru LUSERS #<- :irc.rea.ru 251 Legiona_ :There are 69 users and 230 invisible on 18 servers #<- :irc.rea.ru 252 Legiona_ 18 :operator(s) online #<- :irc.rea.ru 254 Legiona_ 223 :channels formed #<- :irc.rea.ru 255 Legiona_ :I have 16 clients and 1 servers #<- :irc.rea.ru 265 Legiona_ :Current Local Users: 16 Max: 207 #<- :irc.rea.ru 266 Legiona_ :Current Global Users: 299 Max: 2457 bind raw - 251 proc_251 bind raw - 252 proc_251 bind raw - 254 proc_251 bind raw - 255 proc_251 bind raw - 265 proc_251 bind raw - 266 proc_251 #binding 5 minutes intervall bind time - "?5 * * * *" proc_check_lusers bind time - "?0 * * * *" proc_check_lusers #setting lusers file name set lusers_fname "/www/zayka/stats/loosers.html" set ver_info "Lusers.tcl 1.1 by CoolCold" #setting if to show real number of servers or not,set yes to show set show_serv_count "no" #setting if to show number of opers,set to yes to show set show_oper_count "no" proc proc_251 {from keyword arg} { global nick lusers_fname ver_info show_serv_count show_oper_count network #set nick "HostHost" #putlog "$keyword" #creating file if it doesnt exists if {![file exists $lusers_fname]} {set fs [open $lusers_fname w];puts $fs "";close $fs;} #looks like code 251 always goes first - clearing file if {$keyword=="251"} { set fid [open $lusers_fname "TRUNC WRONLY CREAT" ] close $fid;putlog "lusers stream begins...." } #opening file for writing... set fs [open $lusers_fname "APPEND RDWR"] # set piu [lrange $arg 1 end] # puts $fs "$arg" #now processing min/max users,current channels,etc switch -exact $keyword { "251" { #number of servers online set servnum [lrange $arg 9 9] if {$show_serv_count!="yes"} {set servnum "1"} # putlog "$servnum" puts $fs "$nick@$network Network Stats" puts $fs "" puts $fs "

Stats from irc.rea.ru brought to you by $nick

" puts $fs "Last updated at [strftime "%a %d %b %Y %H:%M:%S %z"]
" puts $fs "Total servers online: $servnum
" } "252" { #number of ircops online set opersnum [lrange $arg 1 1] # putlog "$opersnum" puts $fs "operators online: $opersnum
" } "254" { #current channels set channum [lrange $arg 1 1] # putlog "$channum" puts $fs "Count of channels: $channum
" } "265" { #localuser - current & maximum set loccur [lrange $arg 4 4] set locmax [lrange $arg 6 6] # putlog "$loccur $locmax" puts $fs "Count of local users(current): $loccur
" puts $fs "Count of local users(maximum): $locmax
" } "266" { #globaluser - current & maximum set globcur [lrange $arg 4 4];set globmax [lrange $arg 6 6] # putlog "$globcur $globmax" putlog "end of /lusers stream" puts $fs "Count of global users(current): $globcur
" puts $fs "Count of global users(maximum): $globmax
" puts $fs "
Generated with $ver_info" puts $fs "" } } #closing file close $fs return 1 } proc proc_check_lusers {min hour day month year} { #::hostserv::unidentify_all "1" "2" "3" "4" putquick "lusers" return 1 } putlog "$ver_info script loaded"