Code: Select all
set ai_chan "#daigo"
set ai_time 1
set ai_msgs {
"please watch your step"
"i like cookies"
}
proc ai_start {} {
global ai_time
if {[string match *ai_sendmsg* [timers]]} {return 0}
timer [expr [rand $ai_time] + 1] ai_sendmsg
}
proc ai_sendmsg {} {
global botnick ai_chan ai_msgs ai_time
if {[validchan $ai_chan]} {
puthelp "PRIVMSG $ai_chan :[lindex $ai_msgs [rand [llength $ai_msgs]]]"
}
timer [expr [rand $ai_time] + 1] ai_sendmsg
}
set ai_chan [string tolower $ai_chan]
ai_start