Posted to tcl by oxxo at Sun Nov 04 12:56:10 GMT 2007view raw

  1. # speak.tcl v1.1
  2.  
  3. # Configuration #
  4.  
  5. # Set here the channel which the speak messages will appear.
  6. set speaks(chans) "#chan1 #chan2"
  7.  
  8. # Set here the time in minutes which the bot will respect for announcing the messages.
  9. set speaks(time) "60"
  10.  
  11. # Set here the speak message(s).
  12. set speaks_msg {
  13. "\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"
  14. }
  15.  
  16. ### END CONFIG ###
  17.  
  18. if {![string match "*time_speaks*" [timers]]} {
  19. timer $speaks(time) time_speaks
  20. }
  21.  
  22. proc time_speaks {} {
  23. global botnick speaks
  24. foreach channel $speaks(chans) {
  25. set speaks(rmsg) [lindex $speaks(msg) [rand [llength $speaks(msg)]]]
  26. putquick "PRIVMSG $chan :$speaks(rmsg)"
  27. timer $speaks(time) time_speaks
  28. return 1
  29. }
  30. }
  31.  
  32. putlog "TCL Loaded: speak.tcl"
  33.  

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 }