new spoutchan client
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 8 Apr 2005 14:40:55 +0000 (14:40 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 8 Apr 2005 14:40:55 +0000 (14:40 +0000)
spoutchan.tcl [new file with mode: 0755]

diff --git a/spoutchan.tcl b/spoutchan.tcl
new file mode 100755 (executable)
index 0000000..cb601ab
--- /dev/null
@@ -0,0 +1,27 @@
+#!/usr/bin/tclsh8.4
+# usage:
+#   cd ../ircbot
+#   soemthing | ./spoutchan.tcl SERVER PORT NICK IDENT FULLNAME CHANNEL
+
+source irccore.tcl
+
+manyset $argv host port nick ident ownfullname channel
+
+proc connected {} {
+    global channel
+    sendout JOIN $channel
+}
+proc new_event {} { }
+proc privmsg_unlogged {args} { }
+proc msg_366 {args} {
+    fconfigure stdin -blocking no
+    fileevent stdin readable stdinread
+}
+proc stdinread {} {
+    global channel
+    if {[gets stdin l] < 0} return
+    sendprivmsg $channel $l
+}
+
+ensure_connecting
+vwait forever