Posted to tcl by oxxo at Sun Nov 04 12:56:10 GMT 2007view raw
- # speak.tcl v1.1
- # Configuration #
- # Set here the channel which the speak messages will appear.
- set speaks(chans) "#chan1 #chan2"
- # Set here the time in minutes which the bot will respect for announcing the messages.
- set speaks(time) "60"
- # Set here the speak message(s).
- set speaks_msg {
- "\002!ANUNT!\002: Operatorii canlului\002 #baia-mare \002se gandesc la tine si iti umplu buzunarele cu\002 100 \002de\0034 EURO\0034. Mai multe detalii :\002 http://www.dinusinebunii.com/irc/baia-mare.html \002"
- }
- ### END CONFIG ###
- if {![string match "*time_speaks*" [timers]]} {
- timer $speaks(time) time_speaks
- }
- proc time_speaks {} {
- global botnick speaks
- foreach channel $speaks(chans) {
- set speaks(rmsg) [lindex $speaks(msg) [rand [llength $speaks(msg)]]]
- putquick "PRIVMSG $chan :$speaks(rmsg)"
- timer $speaks(time) time_speaks
- return 1
- }
- }
- putlog "TCL Loaded: speak.tcl"
Comments
Posted by wan at Sun Nov 04 13:00:53 GMT 2007 [text] [code]
proc time_speaks {} { global botnick speaks set speaks(rmsg) [lindex $speaks(msg) [rand [llength $speaks(msg)]]] foreach channel $speaks(chans) { putquick "PRIVMSG $chan :$speaks(rmsg)" } timer $speaks(time) time_speaks return 1 }