bind pubm - * test_msg
proc test_msg {nick uhost hand chan arg} {
set rano "[rand 4]"
set randnick [chanlist $chan]
set words $arg
set test(0) "hey $randnick don't ever /msg me like that again!"
set test(1) "$randnick, you really think $randnick should be banned from $chan?"
set test(2) "I dont think its legal to do that to $randnick"
set test(3) "$randnick, that's a crazy idea"
if {[string match "* keyword *" [string tolower $words]]} { putserv "PRIVMSG $chan :$test($rano)" }
}
With this, I'm able to insert _all_ of the nicks in the chanlist, but I can't seem to insert a random nick. I've also tried this:
set randnick [lindex [chanlist $chan] [llength [chanlist $chan]]]
but the output I get is:
<BotNick> , you really think should be banned from $chan?
Any ideas how I might be able to set/change the keyword via a /msg to the bot? Currently, I can edit the file manually, but I figured if It could be done via a msg, it would be a little slicker.