mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 38
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jan 2003
Posts: 38
What if i connected to 3 servers, closed the second server, and then re-connected to it
That would give $scids (or $cids) that are: 1, 3 and 4

Is there anyway to get it or some other identifier to return 1 for cid 1 and 2 for cid 3 and 4 for the cid 4 and so on..??

Note: dunno if its called sequential smile

Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
/help $scon


Code:
//if ( khaled isgod ) echo yes | else echo no
Joined: Jan 2003
Posts: 38
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jan 2003
Posts: 38
i meant if there was any identifier/snippet that would return connection numbers instead of id's

$scon only returns the connection id

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Simple, loop through $scon(N) and check it against $1. If it matches, return N.
Code:
alias cid2n var %i = 1 | while $scon(%i) { if $ifmatch == $1 { return %i } | inc %i }


Use $cid2n(<cid>)


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
Could you please post a script where you need such identifier, or explain it a bit better?

alias con {
if (( $isid ) && ( $scid($1) )) {
var %i = 1, %j = $scon(0)
while ( %i <= %j ) {
if ( $scon(%i) == $1 ) {
return %i
}
}
}
}
This should give you connection number, when you give it Connection ID number, but I still can't think of any use for it...


Code:
//if ( khaled isgod ) echo yes | else echo no
Joined: Jan 2003
Posts: 38
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jan 2003
Posts: 38
well my original post had this:
"What if i connected to 3 servers, closed the second server, and then re-connected to it"

And i need it (at least i think i do) for an treeview switchbar highlight.. currently it works only on one server

see, my sb doesnt recognize text in it as some seem todo, so i need a loop to get the branch that i want, and since theres a new $cid for each connection, i would have to have lots of if's or $iif's.. which i feel is unnecesary

hope that clearifies it all.. anyway, thx for the help!

ps. u forgot an /inc %i wink

Last edited by toe_cutter; 16/04/03 10:28 PM.

Link Copied to Clipboard