mIRC Home    About    Download    Register    News    Help

Print Thread
#138896 08/01/06 02:17 PM
A
Aenei
Aenei
A
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)

#138897 08/01/06 04:00 PM
Joined: Jan 2003
Posts: 1,057
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,057
$scon(N).cid

#138898 08/01/06 04:19 PM
Joined: Jan 2003
Posts: 2,125
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,125
$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.

#138899 08/01/06 04:35 PM
A
Aenei
Aenei
A
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.

#138900 08/01/06 04:42 PM
Joined: Jan 2003
Posts: 2,125
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,125
You're right, it doesn't reassign unused IDs, so CID is always >= N

#138901 08/01/06 05:12 PM
Joined: Feb 2004
Posts: 2,013
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Feb 2004
Posts: 2,013
$findcid() is a handy tool if you are looking to do multi-server stuff.

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

#138902 09/01/06 10:24 AM
Joined: Jan 2003
Posts: 2,125
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,125
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

#138903 09/01/06 12:41 PM
Joined: Feb 2004
Posts: 2,013
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Feb 2004
Posts: 2,013
Ah lol, the example was the basis of my post grin


Link Copied to Clipboard