chiark / gitweb /
topicedit: add a timeout; better error handling
[ircbot.git] / spoutchan.tcl
index cb601abbb2886128d3eb3c777df00d6b7b30c80e..3bdba2800dbd2fd88b402567766e31184a9f2646 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/tclsh8.4
+#!/usr/bin/tclsh8.2
 # usage:
 #   cd ../ircbot
 #   soemthing | ./spoutchan.tcl SERVER PORT NICK IDENT FULLNAME CHANNEL
@@ -12,13 +12,14 @@ proc connected {} {
     sendout JOIN $channel
 }
 proc new_event {} { }
-proc privmsg_unlogged {args} { }
+proc privmsg_unlogged {args} { return 1 }
 proc msg_366 {args} {
     fconfigure stdin -blocking no
     fileevent stdin readable stdinread
 }
 proc stdinread {} {
     global channel
+    if {[eof stdin]} { exit 0 }
     if {[gets stdin l] < 0} return
     sendprivmsg $channel $l
 }