My current usage for $con is for a script that combines the output for all networks into a single @debug window with each line having a header telling the time in milliseconds and that this was the Nth connection, which is more useful (and shorter) than telling me this is connection ID#14556.
[09:35:21.608][6][DALnet] -> rangers.ix.us.dal.net PING :TIMEOUTCHECK
[09:35:21.626][6][DALnet] <- :rangers.ix.us.dal.net PONG rangers.ix.us.dal.net :TIMEOUTCHECK
So to get these 2 values, I'm currently needing to calculate them using 2 different aliases. To get the Nth connection, I needed to use the $con alias I described earlier. The timestamp here is a work-in-progress, and comes from:
alias fakestamp { return $+([,$time($ctime),.,$right($ticksqpc,3),]) }
As for Jigsy's alias, it does work too, but it benchmarks about 3x slower than mine because of the calls to $regsubex and $iif and $findtok. The total time fluctuates depending on how many connections you have open, but for this example while having 7 connections open, I'm getting around 400ms for Jigsy's command and around 140ms for mine
//var %j 999 , %t $ticksqpc | !while (%j) { var %con $findtok($regsubex($str(.,$scon(0)),/./g,$+($iif($scon(\n).cid == $activecid,1,0),.)),1,46) | !dec %j } | !echo -a time $calc($ticksqpc - %t) con: %con
//var %j 999 , %t $ticksqpc | !while (%j) { var %con 1 | !while ($scon(%con).cid != $cid) { !inc %con } | !dec %j } | !echo -a time $calc($ticksqpc - %t) con: %con