###########################
# User in Chat DB eintrag #
###########################
bind join - * noxuseronline
bind time - " * * * *" noxuseronline
bind pub - t noxuseronline
proc noxuseronline { nick uhost hand chan args } {
set ops 0
set halfops 0
set voice 0
set none 0
set nickames ""
set nicks [chanlist #comscopes]
foreach nickname [chanlist #comscopes] {
if {[isop $nickname #comscopes]} {
set nicknamesops($ops) $nickname,
incr ops
} elseif {[ishalfop $nickname #comscopes]} {
set nicknameshalfops($halfops) $nickname,
incr halfops
} elseif {[isvoice $nickname #comscopes]} {
set nicknamesvoice($voice) $nickname,
incr voice
} else {
set nicknamesnone($none) $nickname,
incr none
}
}
if { [array exists nicknamesops] } {
for {set x 0} {$x < $ops} {incr x} {
lappend nicknames "$nicknamesops($x)"
}
}
if { [array exists nicknameshalfops] } {
for {set x 0} {$x < $halfops} {incr x} {
lappend nicknames "$nicknameshalfops($x)"
}
}
if { [array exists nicknamesvoice] } {
for {set x 0} {$x < $voice} {incr x} {
lappend nicknames "$nicknamesvoice($x)"
}
}
if { [array exists nicknamesnone] } {
for {set x 0} {$x < $none} {incr x} {
lappend nicknames "$nicknamesnone($x)"
}
}
if { [info exists nicknames] } {
putlog " --- saving online user ---"
#putlog "$nicknames"
putlog " --- hopely saved ---"
set noxuseronlinedb "/srv/www/htdocs/web1/html/irc/noxuseronline.db"
if {[catch {open $noxuseronlinedb w} fd]} { return }
puts $fd "$nicknames"
close $fd
} else {
putlog "HELP: Notice --- No Userlist to save ---"
putlog "HELP: Notice --- $nicks ---"
putlog "HELP: Notice --- $nicknames ---"
}
}