Code: Select all
array set nickarray {}
#set this to the special flag the user must have
set nickflag "S"
bind join ${nickflag} "*" chk:join
proc chk:join {nick uh hand chan} {
global nickarray
lappend nickarray([string tolower $nick]) $chan
hi_check $nick cb:voice
}
proc cb:voice {nick x} {
global nickarray
foreach chan $nickarray($nick) {
if {(![isop $nick $chan]) && (![isvoice $nick $chan]) && ([onchan $nick $chan])} {
pushmode $chan +v $nick
}
set nickarray($nick) [lrepleace $nickarray($nick) [set idx [lsearch -exact $nickarray($nick) "$chan"]] $idx]]
}
}
bind time - "*" chk:time
proc chk:time {min hour day month year} {
global nickarray nickflag
set min [string trimleft $min 0]
if {![expr $min % 5]} {
foreach chan [channels] {
foreach nick [chanlist $chan $nickflag] {
if {(![isop $nick $chan]) && (![isvoice $nick $chan])} {
hi_check $nick cb:voice
lappend nickarray([string tolower $nick] $chan
}
}
}
}
}