waits to see if there is a join flood or if
the nick has already been +voiced or left
the channel before it tries to +voice him.
Tcl error [auto:voice]:
syntax error in expression "$av_ctr.($chan) >= $av_limit"
This script gives various errors,
I have made many changes without success.
Thank you for any help given.
Dedan
Code: Select all
# Channels you want to auto-voice Nicks on.
# Multiple channels seperated by spaces.
# set av_chans "#TCLhelp #TCLlovers"
set av_chans "#cGameTesting #dGameTesting"
# Set the Max Number of Joins here
set av_limit 3
# During the Number of Seconds here
set av_sec 13
# Set the Number of Seconds to wait before Voicing the Nick here
set av_offset 7
bind join - * auto:voice
proc auto:voice {nick uhost handle chan} {
global botnick av_chans av_limit av_sec av_offset
set chan [string tolower $chan]
if {[botisop $chan]} {
foreach c [string tolower $av_chans] {
if {$c == $chan} {
if {![info exists av_ctr.($chan)]} { set av_ctr.($chan) 0 }
incr av_ctr.($chan) 1
# trying to see what is happening
putserv "PRIVMSG $chan :av_ctr.($chan) is $av_ctr.($chan)"
utimer $av_sec [list av:dec av_ctr.($chan)]
if {$av_ctr.($chan) >= $av_limit} {
return
} else {
utimer $av_offset [list av:voice $nick $chan]
return
}
}
}
}
}
proc av:dec {ctr} {
incr ctr -1
# trying to see what is happening
putserv "PRIVMSG $chan :ctr is $ctr"
}
proc av:voice {vnick vchan} {
if {[onchan $vnick $vchan] && ![isvoice $vnick $vchan]} {
pushmode $vchan +v $vnick
}
}