mIRC Homepage
Posted By: Fixer multi server probs - 31/05/08 01:13 PM
Greetings

This might be a known issue (couldn't confirm).

When I am connected to 3 different networks, from one of the status windows I type the following:

//echo -s $scon(0)
3
//scid 0
//scid 1
//scid 2
* No such connection id: 2

this was working before upgrading from 6.17 to 6.31 (and now to 6.32 this morning).

Bug ? or has this changed and I don't know how to use it now ?
Posted By: RusselB Re: multi server probs - 31/05/08 01:35 PM
The scid command needs the Connection ID, not the connection number, which is what you get using $scon

To get the correct Connection ID, try //echo -a $scon(2).cid
That should return the number you need to use in the /scid command

Note that you can also use /scon 2

Please be careful when using a script with multiple networks, as, given the correct cirumstances, these scripts can be dangerous to your computer. I believe that the above information can be used safely if used as supplied.


Posted By: Fixer Re: multi server probs - 31/05/08 01:44 PM
was there a change to how this all works though ?

like I said in 6.17 I was able to do this.

hmmmmm
tried the following:
//echo -s $scon(0)
3
//echo -s $scon(0).cid
1
//echo -s $scon(1).cid
28
//echo -s $scon(2).cid
37
//scid 1
//echo -s $query(0)
0
//scid 28
//echo -s $query(0)
0
//scid 37
//echo -s $query(0)
0

yet I do have a query window open
Posted By: RusselB Re: multi server probs - 31/05/08 08:11 PM
There have been numerous changes to mIRC since 6.17. You should read through the versions.txt to examine and try to determine if the situation you're experiencing is due to an alteration in mIRC.
Posted By: Fixer Re: multi server probs - 31/05/08 08:36 PM
hmmmmmm the only change to scon or scid was the following in 6.2

67.Fixed /scon /scid display bug when invalid id is used.
Posted By: RusselB Re: multi server probs - 31/05/08 08:50 PM
The problem is, when using the command line, the //echo -a $query(0) always goes to your current connection, not the connection you think it would go to due to the usage of /scid

Try doing it as a script
Code:
alias query_test_1 {
  var %a = 1, %b = $scon(0)
  while %a <= %b {
    var %cid = $scon(%a).cid
    scid %cid
    echo -a Connection ID $cid Queries $query(0)
    inc %a
  }
}

A shorter code that shows the same information
Code:
alias query_test_2 {
  .scon -at1 echo -a $!cid $!query(0)
}

FYI: testing these over 3 networks, the first run ran in 31 milliseconds, the 2nd in 16 milliseconds.
Posted By: qwerty Re: multi server probs - 31/05/08 09:43 PM
If you're doing it from the command line, bear in mind that mirc doesn't "remember" previous commands and their effects, and that a /scid command switches to the specified CID only for the duration of the current script. So if you type //scid 37 and then type //echo -a $query(0), these are considered two separate scripts. To test this properly at the command line, you need to execute both commands in one go, ie type:

//scid 37 | echo -a $query(0)
Posted By: Fixer Re: multi server probs - 01/06/08 01:44 PM
Thank you very much for the examples.

I've been able to update my script to work now smile
© mIRC Discussion Forums