Code: Select all
proc av_devoice {} {
global av_dtime av_nodevoiceflag av_partylog
if {![string match *av_devoice* [timers]]} {timer [expr 1 + [rand 3]] av_devoice}
foreach chan [channels] {
set dtime $av_dtime
if {[av_cdtime $chan] != 0} {
set dtime [av_cdtime $chan]
}
set av_deoplist ""
if {[av_dcheck $chan] == 1} {
foreach user [chanlist $chan] {
set hand [nick2hand $user]
if {[matchattr $hand $av_nodevoiceflag] || [matchattr $hand |$av_nodevoiceflag $chan]} {
continue
}
if {([getchanidle $user $chan] > $dtime) && [isvoice $user $chan]} {
set av_deoplist "$av_deoplist $user"
}
}
if {$av_partylog == 1} {
set count 0
foreach u $av_deoplist {
set count [expr $count + 1]
}
if {($count != 0)} {
putlog "-\[ av.pubmsg \]- devoicing $count users in $chan: $av_deoplist"
}
}
}
}
}
thanks in advance