mIRC Homepage
Posted By: Charlie scon bugs - 05/05/04 03:33 PM
there is a bug with scon, when you have two or more connection (multi-server). where one of connection id are greater than 11.

Code:
how to re-produce:
1. run your mIRC ;)
2. //var %x 1 | while (%x <= 15) { sockopen %x localhost 80 | sockclose %x | inc %x }
   note: it will make it faster to reach connection id greater than 11
3. open new server window (do not connect it), ie: /server -n irc.dal.net
4.  back to first connection id (ALT + 1)
5. //scon $scon(1) echo -s ::: scon test $scon(1)
6. //scon $scon(2) echo -s ::: scon test $scon(2)
   as result, you may get following error: * No such connection id: 16
7. but the correct connection id should be 18, //echo -a ::: $scon(2)
Posted By: greeny Re: scon bugs - 05/05/04 04:40 PM
you have to use /scid not /scon
/help /scid
Posted By: Charlie Re: scon bugs - 06/05/04 11:12 AM
sure, i know about that command, but inside mIRC help there stand:

Quote:

/scid <-rsatM | N> [command]
Changes the active connection for a script to connection id N, where N is a $cid value.
...
The /scon command works in exactly the same way, except that N represents the Nth connection, not a connection id value.


so, where is the bug? mIRC help file or mIRC it self?
Posted By: qwerty Re: scon bugs - 06/05/04 11:49 AM
The mistake is on your end. Both $scon(N) and $scid(N) return a connection ID. So, both identifiers can be used with /scid but NEITHER with /scon. That's because /scon does not accept an ID but a number representing the Nth connection.

However, there seems to be a minor bug in mirc regarding the /scon error message. For example,
//scon $calc($scon(0) + 1) echo -s test
gives
-
* No such connection id: 1
-

The message is incorrect, since /scon doesn't accept an ID to begin with. It should probably say something like
-
* No such connection: <value of $calc($scon(0) + 1)>
-
Posted By: starbucks_mafia Re: scon bugs - 06/05/04 01:38 PM
Although this isn't related to the alleged bug, it does seem bug-like that $scid() returns an ID instead of a connection number, after all what good is an identifier that gives you the same value you inputted. In it's current state $scid() is useless except that it can tell you whether $scid(N) exists, but it could still retain that functionality and return a connection number so I don't get why it doesn't.
Posted By: qwerty Re: scon bugs - 06/05/04 01:58 PM
I suppose $scid(N) is only useful when a property is specified too, eg $scid(3).me is an easy way to get your nick in the connection with ID = 3. But I agree with your suggestion, I would prefer $scid(3) to return the index of the connection with ID = 3.
Posted By: Charlie Re: scon bugs - 07/05/04 07:51 AM
i prefer to use $scon(n).me, so i'm sure that its n active connection (server window) and not just n connection id.
it useful, when you close the 3rd connection id, and make new one so you still have 3 connection to three different server
Posted By: Sephiroth_ Re: scon bugs - 07/05/04 01:25 PM
replace your //scon $scon(2) with //scid $scon(2) - because $scon(N) returns the same as $cid

or you remove $scon() and use only the number there

/scid and /scon are both needed
© mIRC Discussion Forums