/*Simple Cli-Who for FAME!*/
parse arg nodes
y=0
noone=0
if nodes='' then y=1
if nodes='' then nodes=10
if nodes>100 then nodes=100
if ~show('p',"FAME_Server") then noone=1
say ".----.-----------------------.-----.---------------------------.-----------."
say "| nD | uSERNAME              | AC  | aCTION                    | bAUD/bAUD |"
say ":----:-----------------------:-----:---------------------------:-----------:"
do i=0 to nodes
qu=' ';username='------';actn='---';action='- - - - - - -';cbaud='----';ibaud='----';x=' '
if noone=0 then if open(m,"env:nodestats#"i,"R") then do
username=readln(m);actn=readln(m);actn=right(actn,length(actn)-1);action=readln(m);cbaud=readln(m);cbaud=left(cbaud,2)"."right(left(cbaud,3),1);ibaud=readln(m);ibaud=left(ibaud,2)"."right(left(ibaud,3),1);x=readln(m)
call close(m)
end
if x='hidden' then qu='*'
else qu=' '
actn=compress(actn)
if username='!Awaiting!' then username='NO ONE'
say "| "right(i,2,'0')" | "qu||left(username,20)" | "right(actn,3,'0')" | "left(action,25)" | "left(cbaud,4)"/"left(ibaud,4)" |"
end
say "`----^-----------------------^-----^---------------------------^-----------'"
if y=1 then say center("USAGE: who <HIGHEST NODE>",76)
exit