I have modified the auto voice after talking some lines. And added udef flag for matching channels and unset the variable after voicing them but i am getting error... The script is as follows:
# Set Number of lines for the bot to voice
set vline 4
# Set in max number of seconds here.
set vsec 25
setudef flag voice
bind pubm - * voice:user
proc voice:user {nick uhost hand chan arg} {
global actvoice vline vsec
if {([isop $nick $chan]) || ([isvoice $nick $chan])} {return 0}
if {[lsearch -exact [channel info $chan] +voice] == -1} {return 0}
if {![info exists actvoice([string tolower $nick])]} { set actvoice([string tolower $nick]) 0 }
incr actvoice([string tolower $nick])
utimer $vsec [list incr actvoice([string tolower $nick]) -1]
if {$actvoice([string tolower $nick]) >= $vline} {
putserv "MODE $chan +v $nick"
unset actvoice([string tolower $nick])
}
}
the error i am getting from the bot in party line after voicing is as follows:
[12:29] #THRRaaga: mode change '+v Romeyo' by THRraaga!rakesh@stand.up.for.the.mast3r.com
[12:29] Tcl error in script for 'timer366':
[12:29] can't read "actvoice(romeyo)": no such element in array
[12:29] Tcl error in script for 'timer367':
[12:29] can't read "actvoice(romeyo)": no such element in array
[12:29] Tcl error in script for 'timer368':
[12:29] can't read "actvoice(romeyo)": no such element in array
[12:30] Tcl error in script for 'timer369':
[12:30] can't read "actvoice(romeyo)": no such element in array