5 server=irc.freenode.net
20 echo QUIT : Leaving... > $netdir/data
29 date | awk '{print $4}' | awk -F ':' '{print "[" $1 ":" $2 "]"}'
33 echo USER $user foo bar :$realname > $netdir/data
34 echo NICK $nick > $netdir/data
36 echo PRIVMSG 'nickserv :'identify $"pass > $netdir/data
39 echo JOIN $target > $netdir/data
42 target = `{echo $target | awk -F',' '{print $NF}'}
46 echo QUIT : Leaving... > $netdir/data
53 eval `{mshift $cmd} | while(rc=`{read})echo 'PRIVMSG '^$target^' :' $rc | tee $netdir/data
55 msg = (MODE `{mshift $cmd})
59 msg = (NOTICE $cmd(1) : `{mshift $cmd})
61 msg = (TOPIC `{mshift $cmd})
63 msg = (WHOIS `{mshift $cmd})
65 msg = (AWAY : `{mshift $cmd})
70 msg = (JOIN `{mshift $cmd})
72 target = `{echo $target | awk -F',' '{print $NF}'}
75 msg = (LIST `{mshift $cmd})
81 out = '('^$to^') ⇐ '^$"cmd
82 msg = 'PRIVMSG '^$to^' :'^$"cmd
90 msg = (PART $cmd(1) : `{mshift $cmd})
94 target = `{mshift $cmd}
97 msg = (USERS `{mshift $cmd})
99 msg = (WHO `{mshift $cmd})
101 echo QUIT : Leaving... > $netdir/data
106 msg = 'PRIVMSG '^$target^' :'^$"cmd
107 out = '('^$target^') ⇐ '^$"cmd
110 echo $msg > $netdir/data
112 echo `{etime}^' '^$out
119 s/!~?[a-zA-Z0-9_@\-|.{=\/:]+ /:/' |
122 s = $2 " «" $1 "»\t" $3;
123 for(i = 4; i < NF+1; i++)
131 s/^NOTICE /:'^$server^':/
133 s/!~?[a-zA-Z0-9_@\-|.{=\/]+ /:/' |
136 s = "-" $1 "- ⇒\t" $3;
137 for(i = 4; i < NF+1; i++)
144 sed 's/^:[a-zA-Z0-9_@\-|.!=#]+ //
146 s/^353= /*** Users on /
147 s/^[0-9][0-9][0-9] ?:?/*** /'
153 s/!~?[a-zA-Z0-9_@\-|.{=\/:]+ PRIVMSG /» ⇒ :/
154 s/#[a-zA-Z0-9_@\-|.#]+/(&)/' |
158 for(i = 4; i < NF+1; i++)
165 while (line=`{read}) {
168 line = `{echo -n $line | privmsg}
169 case *JOIN* *QUIT* *PART* *NICK*
170 line = `{echo -n $line | misc}
172 line = `{echo -n $line | notice}
174 echo -n $line | sed 's/PING/PONG/' > $netdir/data
177 line = `{echo -n $line | numeric}
187 if (test -f /mnt/acme/$winid/ctl)
188 echo name /$server/$target/-ircrc > /mnt/acme/$winid/ctl
191 label $target@$server
211 echo 'usage: ircrc [-p port] [-r realname] [-t target] [-n nick] [-T] [server]' >[1=2]
220 server=im.bitlbee.org
229 userpass=`{auth/userpasswd 'server='^$server^' service=irc user='^$nick >[2]/dev/null}
237 echo connecting to tcp!$server!$port...
239 aux/trampoline tcp!$server!$port <>$p/data1 >[1=0] &
242 tlsclient tcp!$server!$port <>$p/data1 >[1=0] &
245 cat $netdir/data | tr -d '\x2\xd\x1f' | pretty &