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

proc set_msgs {nick uhost hand channel text} {
global joinmsgs partmsgs
set what [lindex $text 0]
set message [lrange $text 1 end]
	if {$what == "" || $what == " " || $text == "" || $text == " "} {
		putquick "PRIVMSG $channel :$nick USAGE: !set <join-msg/part-msg> <\$text>"
	} else {
		switch -- $what {
			join-msg {
				set joinmsgs($channel) $message
				putquick "PRIVMSG $channel:$nick SET join-msg on $channel to: $message"
			}
	
			part-msg {
				set partmsgs($channel) $message
				putquick "PRIVMSG $channel:$nick SET part-msg on $channel to: $message"
			}

			default { putquick "PRIVMSG $channel :$nick USAGE: !set <join-msg/part-msg> <\$text>" }
		}
	}
}