mIRC Home    About    Download    Register    News    Help

Topic Options
#265316 - 30/03/19 03:24 PM /scon -n networkname [n] [command]
Raccoon Offline
Hoopy frood

Registered: 18/02/03
Posts: 2597
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
Well. At least I won lunch.
Good philosophy, see good in bad, I like!

#265350 - 03/04/19 04:51 PM Re: /scon -n networkname [n] [command] [Re: Raccoon]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3509
Loc: France
In addition, I'd like to see /scon -1 supported, to act on the lastest status windows (clarification for Saturn: it would be the same as using $scon(0), not $lactivecid)
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net