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