mIRC Home    About    Download    Register    News    Help

Print Thread
sequential $cid of connected servers #19382 15/04/03 07:44 PM
Joined: Jan 2003
Posts: 38
T
toe_cutter Offline OP
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

Re: sequential $cid of connected servers #19383 15/04/03 09:19 PM
Joined: Dec 2002
Posts: 774
T
theRat Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
/help $scon


Code:
//if ( khaled isgod ) echo yes | else echo no
Re: sequential $cid of connected servers #19384 16/04/03 09:56 AM
Joined: Jan 2003
Posts: 38
T
toe_cutter Offline OP
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

Re: sequential $cid of connected servers #19385 16/04/03 12:16 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
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
Re: sequential $cid of connected servers #19386 16/04/03 12:27 PM
Joined: Dec 2002
Posts: 774
T
theRat Offline
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
Re: sequential $cid of connected servers #19387 16/04/03 10:02 PM
Joined: Jan 2003
Posts: 38
T
toe_cutter Offline OP
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.