This would be extremely easy to make:
alias con var %i = 0 | scon $+(-at,$1 inc %,i) | return %i
$con(<number>) as it is used with scon:
1 = server connected, 2 = not connected, 4 = connecting, 8 = not connecting
This number is a bitmask, so you can specify fex 3 (= 1 + 2)