mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2003
Posts: 2,812
Raccoon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
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.

Code:
; $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!
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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)


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard