ircrc: various improvements (thanks again pap!)

the -t option was ineffective. this fixes is.

fix incompatibility with 9vx as its tcp/status
file returns slightly different format than
Plan 9.

strip annoying  character from nickserv.
This commit is contained in:
cinap_lenrek 2012-10-12 01:05:34 +02:00
parent b786ff0544
commit fe13029eb4

View file

@ -34,6 +34,10 @@ fn work {
echo NICK $nick > $netdir/data echo NICK $nick > $netdir/data
if (~ $#pass 1) if (~ $#pass 1)
echo PRIVMSG 'nickserv :'identify $"pass > $netdir/data echo PRIVMSG 'nickserv :'identify $"pass > $netdir/data
if(~ $#target 1){
title
echo JOIN $target > $netdir/data
}
while (cmd=`{read}) { while (cmd=`{read}) {
msg=() msg=()
out=() out=()
@ -148,7 +152,7 @@ fn privmsg {
} }
fn pretty { fn pretty {
while (~ `{cat $netdir/status} Established*) { while (~ `{cat $netdir/status} *Established*) {
line=`{read} line=`{read}
switch ($line) { switch ($line) {
case *JOIN* *QUIT* *PART* *NICK* case *JOIN* *QUIT* *PART* *NICK*
@ -231,6 +235,6 @@ if(~ $#userpass 2 && ~ $nick $user) {
netdir=`{basename -d $clonefile} ^ / ^ `{cat /fd/4} netdir=`{basename -d $clonefile} ^ / ^ `{cat /fd/4}
echo connect $ip!$port >$netdir/ctl || exit 'cannot connect' echo connect $ip!$port >$netdir/ctl || exit 'cannot connect'
echo connected to tcp!$ip!$port on $netdir echo connected to tcp!$ip!$port on $netdir
cat $netdir/data | tr -d ' ' | pretty & cat $netdir/data | tr -d ' ' | pretty &
work work
} }