mIRC Homepage
Posted By: coder Is it possible to rename connection id ($cid) - 20/06/06 10:25 PM
possible ? example changing the $cid = 3 to connection3 ..
No. The connection ID is set when the connection is made.
I would suggest using $scon rather than $scid as $scon reference the connection in the order it was created (ie: first connection is 1, 2nd is 2, 3rd is 3). Now, while this sounds like it's the same as $scid, $scid uses the $cid information to reference that connection, as $scon references the connection number.

I'm sorry I can't explain it better. I suggest you read the help file under /help $scon & /help $scid (both are actually in the same area) and compare the differences.
each new connection gets a unique new cid
The first (quakenet)= 1
the 2nd (undernet) = 2
the third (EFnet) = 3

if we close the Undernet connection and open a new one to Rizon, Rizon is 4.
QuakeNet = 1
EFnet = 3
Rizon = 4

As you can see if we'd loop trough $scid it would fail since theres no $scid(2). cid is ALWAYS unique so having named connections defeats its purpose.

scon is a method to reference all the open connections
$scon(0) returns total connections
$scon(1) returns the first connection (even if the $cid > 1)

If you follow the following rules then addressing the wrong/an invalid connection is less likely to happen:

If you want to dynamicly reference all the open servers use SCON.
if you need to store information with a connection id as a reference use SCID.

You can check if a connection is to a certain server with
$scon(N).network
$scon(N).server
oWh thx

is opening socket via /sockopen is considered as $cid too ?
because it's weird for me when echoing $cid and it returns 34
© mIRC Discussion Forums