mIRC Homepage
Posted By: TomT Need counterpart to $scon(N).network - 01/01/03 12:54 PM
Is there a quick method of getting the connection id of any of the networks you may have joined. I have a script that is tracking nicks. In a multi-server environment, those nicks can be on different servers. So I am thinking the most logical method would be to store the network related to a specific nick. For the script to work I need to be able to have the script determine the current connection id of a stored network (since the connection id might change from connection to connection based on the users habits for restarting mIRC).

$scon(N).network tells me the network related to a specific connection. Is there a command that does the reverse, tells me the connection id of a specific network? No doubt an alias can be created to accomplish the chore, but the question is.. does mIRC already provide the information.
Posted By: Hammer Re: Need counterpart to $scon(N).network - 01/01/03 01:24 PM
if ($scon(1).network == EFnet) set %EFnet.cid $scon(1).cid
elseif ($scon(1).network == DALnet) set %DALnet.cid $scon(1).cid
elseif ($scon(1).server == irc.mynetwork.net) set %MyNetwork.cid = $scon(1).cid

You can use $scon(N).anyIdentifier .. like $scon(1).me would return your current nick on that connection, $scon(1).active would return the active window on that connection, etc.
Posted By: TomT Re: Need counterpart to $scon(N).network - 01/01/03 02:13 PM
Excellent advice!

Is it safe to say that once a scon or scid is done that it affects only the alias in which it was performed?
Posted By: Hammer Re: Need counterpart to $scon(N).network - 02/01/03 05:08 AM
Your example doesn't change to a different /scid N or /scon N, so no connection switching is taking place. $identifiers almost always return the current state information of whatever you're testing so, again, nothing is changing, just being reported to your script (which then sets that data into a variable for later use).
© mIRC Discussion Forums