Riddler Halfop
Joined: 20 May 2007 Posts: 60 Location: Brasov, Romania
|
Posted: Sat Nov 03, 2007 11:38 am Post subject: Say a random text on 2 or more channels at once |
|
|
Hello guys, I've made a code that will randomly send a text to a channel, but only if that channel has set +speak flag
Here is the code :
| Code: |
# say.tcl
### CONFIG ###
set speak(time) "2"
set speak(type) "PRIVMSG"
set speak(msgs) {
"text1"
"text2"
}
### CODE ###
setudef flag speak
if {![string match "*speaks*" [timers]]} {
timer $speak(time) s:speaks
}
proc s:speaks { } {
global speak
if {![channel get $chan speak]} { return 0 }
set rmsg [lindex $speak(msgs) [rand [llength $speak(msgs)]]]
putserv "$speak(type) $chan :$rmsg"
return 1
timer $speak(time) s:speaks
return 0
}
putlog "Loaded: say.tcl" |
The problem is that the bot dosen't give me eny error and the messages ar not sent to the channels that I've set the +speak flag..
What's the problem ?!
Thanks _________________ I am a man of few words, but many riddles |
|