+proc msg_PRIVMSG {p c dest text} {
+ prefix_nick
+ if {[regexp {^[&#+!]} $dest]} {
+ set what "!..."
+ set them it
+ } else {
+ set what "private messages"
+ set them them
+ }
+ sendout PRIVMSG $n \
+ "I will respond to $what at some point; for now I just log $them."
+}
+
+if {![info exists sock]} {
+ set sock [socket $host $port]
+ fconfigure $sock -buffering line
+ #fconfigure $sock -translation binary
+ fconfigure $sock -translation crlf
+
+ sendout USER guest 0 * ":chiark testing bot"
+ sendout NICK $nick
+ fileevent $sock readable onread
+}
+
+if {![regexp {tclsh} $argv0]} {
+ vwait terminate
+}