Posted to tcl by EvaLuaTe at Mon Sep 03 11:37:11 GMT 2007view raw

  1. proc set_msgs {nick uhost hand channel text} {
  2. global joinmsgs partmsgs
  3. set what [lindex $text 0]
  4. set message [lrange $text 1 end]
  5. if {$what == "" || $what == " " || $text == "" || $text == " "} {
  6. putquick "PRIVMSG $channel :$nick USAGE: !set <join-msg/part-msg> <\$text>"
  7. } else {
  8. switch -- $what {
  9. join-msg {
  10. set joinmsgs($channel) $message
  11. putquick "PRIVMSG $channel:$nick SET join-msg on $channel to: $message"
  12. }
  13.  
  14. part-msg {
  15. set partmsgs($channel) $message
  16. putquick "PRIVMSG $channel:$nick SET part-msg on $channel to: $message"
  17. }
  18.  
  19. default { putquick "PRIVMSG $channel :$nick USAGE: !set <join-msg/part-msg> <\$text>" }
  20. }
  21. }
  22. }
  23.