on *:TEXT:!allserv:#: {
var %servers = $scon(0),%x = 0
msg $chan I'm on $scon(%servers) networks, though I may not be connected to them.
while (%x < %servers) {
inc %x
msg $chan Connection %x - Network: $scon(%x).network Server: $scon(%x).server Port: $scon(%x).port Status: $scon(%x).status
}
}
Does the same thing, but a bit cleaner. This will also support you being on as many servers as you would like. It could be 1 or 100, and it'll work (although that many and you'll likely flood the channel and get in trouble)
*When increasing or decreasing a variable, if it's going up or down by 1 you do not have to specify the amount to increase or decrease it.
When using this as a channel-only command (like where it's posting to the channel), use # instead of in the ON TEXT event, otherwise people could keep PMing you with the command.
*You should use var instead of set for these variables, since they're only used within this snippet and don't need to be remembered forever, just for the length of the script.