You can count the number of open status windows (whether connected or not), using $scon(0)
Note that is a 0 (zero) not an O (oh)