mIRC Home    About    Download    Register    News    Help

Print Thread
#200257 31/05/08 01:13 PM
Joined: May 2008
Posts: 4
F
Fixer Offline OP
Self-satisified door
OP Offline
Self-satisified door
F
Joined: May 2008
Posts: 4
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 ?

Last edited by Fixer; 31/05/08 01:20 PM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.



Joined: May 2008
Posts: 4
F
Fixer Offline OP
Self-satisified door
OP Offline
Self-satisified door
F
Joined: May 2008
Posts: 4
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

Last edited by Fixer; 31/05/08 01:48 PM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Joined: May 2008
Posts: 4
F
Fixer Offline OP
Self-satisified door
OP Offline
Self-satisified door
F
Joined: May 2008
Posts: 4
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.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
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)


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: May 2008
Posts: 4
F
Fixer Offline OP
Self-satisified door
OP Offline
Self-satisified door
F
Joined: May 2008
Posts: 4
Thank you very much for the examples.

I've been able to update my script to work now smile


Link Copied to Clipboard