mIRC Homepage

Multiserver identifiers

Posted By: Aenei

Multiserver identifiers - 08/01/06 02:17 PM

Was just wondering how I can turn a connection ID into a connection ID? Its easy enough to do the other way round after all
Code:
$scon(N)
Posted By: Doqnach

Re: Multiserver identifiers - 08/01/06 04:00 PM

$scon(N).cid
Posted By: qwerty

Re: Multiserver identifiers - 08/01/06 04:19 PM

$scon(N).cid is the same as $scon(N), ie returns the CID of the Nth Status. I believe the OP's looking for something like this:
Code:
alias con var %a | scon -a $(%a = %a $cid,) | return $findtok(%a,$1,32)


$con(5) returns 3 if the CID of the 5th Status is 3.
Posted By: Aenei

Re: Multiserver identifiers - 08/01/06 04:35 PM

Aha, I was hoping that there was some simple way to do it I had missed and that it wouldn't be needed to resort to something like that qwerty. As a matter of interest, can the cid of the Nth connection be <N? I thought that mirc assigned cid's as the connections were made, so first that connection id is always >= connection number - or will it reassign unused connection IDs? I think it probably wouldn't, or shouldn't at least, for obvious reasons.
Posted By: qwerty

Re: Multiserver identifiers - 08/01/06 04:42 PM

You're right, it doesn't reassign unused IDs, so CID is always >= N
Posted By: FiberOPtics

Re: Multiserver identifiers - 08/01/06 05:12 PM

$findcid() is a handy tool if you are looking to do multi-server stuff.

@qwerty: that ought to be $gettok instead of $findtok
Posted By: qwerty

Re: Multiserver identifiers - 09/01/06 10:24 AM

Actually the code is correct, it's the example I gave that's wrong:

$con(5) returns 3 if the CID of the 5th Status is 3.
should be
$con(5) returns 3 if the CID of the 3rd Status is 5.

Using $gettok() would make it equivalent to $scon(N), ie pointless smile
Posted By: FiberOPtics

Re: Multiserver identifiers - 09/01/06 12:41 PM

Ah lol, the example was the basis of my post grin
© 2020 mIRC Discussion Forums