mIRC Home    About    Download    Register    News    Help

Print Thread
#138896 08/01/06 02:17 PM
Joined: Nov 2005
Posts: 42
A
Aenei Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Nov 2005
Posts: 42
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,063
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,063
$scon(N).cid


If it ain't broken, don't fix it!
#138898 08/01/06 04:19 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
$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.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#138899 08/01/06 04:35 PM
Joined: Nov 2005
Posts: 42
A
Aenei Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Nov 2005
Posts: 42
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,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
You're right, it doesn't reassign unused IDs, so CID is always >= N


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#138901 08/01/06 05:12 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
$findcid() is a handy tool if you are looking to do multi-server stuff.

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


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


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#138903 09/01/06 12:41 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Ah lol, the example was the basis of my post grin


Gone.

Link Copied to Clipboard