:lusers formatting
:module
:

# stolen from cypress' stolen from argon.
 
on ^001 * { # }
on ^002 * { # }
on ^003 * { # }
on ^004 * {
	@ _lu.v = [$2]
}
on ^251 * {
	echo $fparse(format_header $S)
	^on ^raw_irc "$S % $N :Highest connection count*" {
		@ _lu.lum = _lu.um = []
		^shook 266 0 0 0 0 0 0 0
	}
	@ _lu.u = [$3] + [$6]
	@ _lu.i = [$6]
	@ _lu.s = [$9]
}
on ^252 * {
	@ _lu.o = [$1]
}
on ^254 * {
	@ _lu.c = [$1]
}
on ^255 * {
	@ _lu.lu = [$3]
	@ _lu.ls = [$6]
}
on ^265 * {
	@ _lu.lum = [$6]
}
on ^266 * {
	^on ^raw_irc -"$S % $N :Highest connection count*" #
	@ _lu.um = [$6]
	^set floating_point_math_var on
	echo $fparse(format_midbar $(c1)g$(c2)lobal users$(c4).. $(cl)$[5]_lu.u ${_lu.um?[$(cl)max$(c4).. $(cl)$[5]_lu.um ]:}$(c4)\($(cl)$_lu.i invisible, $_lu.o operators$(c4)\))
	echo $fparse(format_midbar $(c1)l$(c2)ocal users$(c4)... $(cl)$[5]_lu.lu ${_lu.lum?[$(cl)max$(c4).. $(cl)$[5]_lu.lum ]:}$(c4)\($(cl)$trunc(1 ${100 * _lu.lu / _lu.u})\%$(c4)\))
	echo $fparse(format_midbar $(c1)s$(c2)ervers$(c4)....... $(cl)$[5]_lu.s $(c4)\($(cl)$trunc(1 ${_lu.u / _lu.s}) avg users per server$(c4)\))
	echo $fparse(format_midbar $(c1)c$(c2)hannels$(c4)...... $(cl)$[5]_lu.c $(c4)\($(cl)$trunc(1 ${_lu.u / _lu.c}) avg users per channel$(c4)\))
	echo $fparse(format_footer $S)
}