Code: Select all
set vlist "vnick.txt"
bind join - * voice:join
proc voice:join {nick uhost handle chan} {
if {[isbotnick $nick] || ![botisop $chan] || ![file exists $::vlist]} {
return
}
set f [open $::vlist r]
while {[gets $f n]>-1} {
if {[string match -nocase $nick $n]} {
pushmode $chan +v $nick
}
}
}
Code: Select all
#make sure this points to the right location of your file
set vlist "[pwd]/scripts/vnick.txt"
#just add more binds and change the channelname if you want more channels...
bind join - "#channel1 *" voice:join
bind join - "#channel2 *" voice:join
proc voice:join {nick uhost handle chan} {
if {[isbotnick $nick] || ![botisop $chan] || ![file exists $::vlist]} {
return
}
set f [open $::vlist r]
while {[gets $f n]>-1} {
if {[string match -nocase $nick $n]} {
pushmode $chan +v $nick
}
}
}
Code: Select all
bind mode - "#channel1 +v" proc:addtofile
proc proc:addtofile {nick host hand chan mc vc} {
set fid [open $::vlist a]
puts $fid $vc
catch {close $fid}
}
Code: Select all
set vlist "vnick.txt"
bind mode - "#channel +v" vlist:add
proc vlist:add {nick host hand chan mc vc} {
set f [open $::vlist a]
set i 0
while {[gets $f n]>-1} {
if {[string match -nocase $vc $n]} {
incr i
}
}
if {$i} {
puts $f $vc
}
close $f
}
Code: Select all
set vlist "vnick.txt"
bind mode - "#channel +v" vlist:add
proc vlist:add {nick host hand chan mc vc} {
set f [open $::vlist a]
set i 0
while {[gets $f n]>-1} {
if {[string match -nocase $vc $n]} {
incr i
}
}
if {$i} {
puts $f $vc
}
close $f
}
Code: Select all
set vlist "vnick.txt"
bind join - "#channel *" voice:join
proc voice:join {nick uhost handle chan} {
if {[isbotnick $nick] || ![botisop $chan] || ![file exists $::vlist]} {
return
}
set f [open $::vlist r]
while {[gets $f n]>-1} {
if {[string match -nocase $nick $n]} {
pushmode $chan +v $nick
}
}
}
Code: Select all
set f [open $::vlist a]
#should be:
set f [open $::vlist a+]
Code: Select all
bind mode - "* +v *" auto:addvoice
proc auto:addvoice {nick uhost hand chan text} {
if {![validuser $hand]} {
adduser $nick [maskhost $uhost]
chattr $nick +v $chan
}
}