Use the default system Tcl.
[ircbot] / spoutchan.tcl
CommitLineData
df78d81f 1#!/usr/bin/tclsh
1f7559c9
IJ
2# usage:
3# cd ../ircbot
4# soemthing | ./spoutchan.tcl SERVER PORT NICK IDENT FULLNAME CHANNEL
5
6source irccore.tcl
7
8manyset $argv host port nick ident ownfullname channel
9
10proc connected {} {
11 global channel
12 sendout JOIN $channel
13}
14proc new_event {} { }
16d57a7f 15proc privmsg_unlogged {args} { return 1 }
1f7559c9
IJ
16proc msg_366 {args} {
17 fconfigure stdin -blocking no
18 fileevent stdin readable stdinread
19}
20proc stdinread {} {
21 global channel
aedb69d5 22 if {[eof stdin]} { exit 0 }
1f7559c9
IJ
23 if {[gets stdin l] < 0} return
24 sendprivmsg $channel $l
25}
26
27ensure_connecting
28vwait forever