Request to extend /scon to support a network name instead of number, or in combination with a number if connected to the same network multiple times. This can be implemented with or without a new command switch, eg, -n.
scon freenode
msg ##mirc Greetings from EFnet!
scon -r/scon freenode /msg ##mIRC hi.
/scon freenode 2 /msg ##mIRC hi.
/scon -n freenode 2 /msg ##mIRC hi.I don't think the -n switch is wholly necessary, given that /scon is currently only looking for a switch or a number for the first parameter, so introducing a text string should be easy to recognize as a network name. Or network/group/serveraddress name. I guess if the -a switch is to work along with a network name, then an -n switch would indeed be necessary.
As an aside, for anyone who needs something to help them navigate their connections, here's a scripted function that will help. It goes in your Aliases section.
; $networkcid(network-wildcard, [n]) -- returns the nth matching connection id of the given network name.
; example: //scid $networkcid(freenode) msg ##mIRC Hello from EFNet!
; example: //echo -a You are connected to $networkcid(*net*,0) networks with "net" in their name.
networkcid {
var %netwild = $1, %nth = $iif($2 isnum,$2,1)
var %i = 1, %n = $scon(0), %ith = 0
while (%i <= %n) {
if (%netwild iswm $scon(%i).network) inc %ith
if (%ith == %nth) return $scon(%i)
inc %i
}
if (%nth == 0) return %ith
} ; by Raccoon 2019