mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 18
T
TomT Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Dec 2002
Posts: 18
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.

Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
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.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Dec 2002
Posts: 18
T
TomT Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Dec 2002
Posts: 18
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?

Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
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).


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Link Copied to Clipboard