diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-10-12 01:05:34 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-10-12 01:05:34 +0200 |
commit | fe13029eb4b1dbef093650cd2e0ab966e63bdab2 (patch) | |
tree | f2e4ca16d3c10c23a32a6ad20d76db7ffff8f741 | |
parent | b786ff0544385a1219fb33a39fa6f0e15f49b846 (diff) | |
download | plan9front-fe13029eb4b1dbef093650cd2e0ab966e63bdab2.tar.xz |
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.
-rwxr-xr-x | rc/bin/ircrc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/rc/bin/ircrc b/rc/bin/ircrc index 4e18a37c3..e54d2a000 100755 --- a/rc/bin/ircrc +++ b/rc/bin/ircrc @@ -34,6 +34,10 @@ fn work { echo NICK $nick > $netdir/data if (~ $#pass 1) echo PRIVMSG 'nickserv :'identify $"pass > $netdir/data + if(~ $#target 1){ + title + echo JOIN $target > $netdir/data + } while (cmd=`{read}) { msg=() out=() @@ -148,7 +152,7 @@ fn privmsg { } fn pretty { - while (~ `{cat $netdir/status} Established*) { + while (~ `{cat $netdir/status} *Established*) { line=`{read} switch ($line) { case *JOIN* *QUIT* *PART* *NICK* @@ -231,6 +235,6 @@ if(~ $#userpass 2 && ~ $nick $user) { netdir=`{basename -d $clonefile} ^ / ^ `{cat /fd/4} echo connect $ip!$port >$netdir/ctl || exit 'cannot connect' echo connected to tcp!$ip!$port on $netdir - cat $netdir/data | tr -d '
' | pretty & + cat $netdir/data | tr -d '
' | pretty & work } |