Code: Select all
bind join - * auto_voice
proc auto_voice {nick uhost hand channel } {
if {![matchattr $hand q|q $channel]} {
utimer [expr 1700 + [rand 200]] if {((![isvoice $nick $channel]) && ([ison $nick $channel]) && (![matchattr $hand q|q $channel]))} {pushmode $channel +v $nick}
}
}
this would return an error like:utimer [expr 1700 + [rand 200]] if {((![isvoice $nick $channel]) && ([ison $nick $channel]) && (![matchattr $hand q|q $channel]))} {pushmode $channel +v $nick}
better calling another proc in timerTcl error: wrong # args: should be "utimer seconds command"
Code: Select all
utimer [expr 1700 + [rand 200]] [list voice:user $nick $channel $hand]
Code: Select all
proc voice:user {nick channel hand} {
if {((![isvoice $nick $channel]) && ([ison $nick $channel]) && (![matchattr $hand q|q $channel]))} {pushmode $channel +v $nick}
}