mIRC Homepage
Posted By: toe_cutter sequential $cid of connected servers - 15/04/03 07:44 PM
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
Posted By: theRat Re: sequential $cid of connected servers - 15/04/03 09:19 PM
/help $scon
Posted By: toe_cutter Re: sequential $cid of connected servers - 16/04/03 09:56 AM
i meant if there was any identifier/snippet that would return connection numbers instead of id's

$scon only returns the connection id
Posted By: qwerty Re: sequential $cid of connected servers - 16/04/03 12:16 PM
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>)
Posted By: theRat Re: sequential $cid of connected servers - 16/04/03 12:27 PM
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...
Posted By: toe_cutter Re: sequential $cid of connected servers - 16/04/03 10:02 PM
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
© mIRC Discussion Forums