A working version would be:
Code: Select all
set chanvoice(channel) "#channel"
set chanvoice(file) "chanvoice.txt"
bind join -|- {*} chanvoice:join
bind raw -|- {354} chanvoice:raw
proc chanvoice:join {nick host hand chan} {
global chanvoice
if {![string equal -nocase $chanvoice(channel) $chan]} { return }
puthelp "WHO $nick n%at,88"
}
proc chanvoice:raw {from raw arg} {
global chanvoice
set tag [lindex [split $arg] 1]
if {$tag != "88"} { return }
set nick [lindex [split $arg] 2]
set auth [lindex [split $arg] 3]
if {$auth == "" || $auth == "0"} { return }
set data [read -nonewline [set file [open "$chanvoice(file)" r]]]
close $file
foreach x [split $data \n] {
if {$x == ""} { return }
if {[string equal -nocase $auth $x]} {
pushmode $chanvoice(channel) +v $nick
break
}
}
}