mIRC Home    About    Download    Register    News    Help

Print Thread
#138930 08/01/06 11:45 PM
Joined: Nov 2004
Posts: 842
Jigsy Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Nov 2004
Posts: 842
I'm having a lot of trouble with $scid and $scon, at the moment I'm trying to fix my titlebar script and having no luck what-so-ever. i get errors like:

-
* No such connection id: 3
-

When I'm in fact connected to that server, the titlebar shows up correctly for that server but on connection id eight its telling me I'm disconnected and im in fact connected.

I've tried using variables and identifiers such as %id, $activecid, $cid etc.

Code:
  on *:active:*:{ set %id $activecid }


I've also noticed that $scid(0) returns 5 but $scid(5) returns nothing, however $scon(0) returns 5 and $scon(5) returns 8.

I was just wondering if this was a bug or not?


What do you do at the end of the world? Are you busy? Will you save us?
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Quote:
I've also noticed that $scid(0) returns 5 but $scid(5) returns nothing, however $scon(0) returns 5 and $scon(5) returns 8.


That is entirely possible.

SCON: 1 | 2 | 3 | 4 | 5
SCID: 1 | 3 | 4 | 6 | 8

SCON refers to the connection number starting at 1 on the top-left of the switchbar and increasing by 1 as you move left and down.

SCID refers to a unique identifier given to each connection that is not reused in the life of that mIRC session.

$scid(5) returns nothing because there is no server connection with that CID. This may be because you opened that server connection, and have since closed it. Once CID 5 is used, it cannot be reused until you restart mIRC.

$scon(5) returns 8 because the 5th server connection from the top-left has a CID of 8.

You must have opened and closed 3 server connections since you started your current mIRC session.


The problem with your titlebar may be that your are using $scon where you should be using $scid, or vice versa. You probably have something like this:

if ($scon(8).status == connected) titlebar ONLINE
else titlebar OFFLINE

You would have a variable of some sort here

So when $scon( ).status doesn't return 'connected' (it returns null), the script defaults to displaying 'OFFLINE'.

-genius_at_work

Last edited by genius_at_work; 09/01/06 12:03 AM.
Joined: Nov 2004
Posts: 842
Jigsy Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Nov 2004
Posts: 842
Quote:

You must have opened and closed 3 server connections since you started your current mIRC session.
-genius_at_work


I haven't believe it or not or been /killed or disconnected.

Last edited by Jigsy; 09/01/06 12:06 AM.

What do you do at the end of the world? Are you busy? Will you save us?
Joined: Dec 2002
Posts: 230
G
Fjord artisan
Offline
Fjord artisan
G
Joined: Dec 2002
Posts: 230
Quote:
You must have opened and closed 3 server connections since you started your current mIRC session.

That is not correct. I do not know how mIRC creates the connection ID's, but sometimes I had only 3-4 server windows open and wound up with a CID > 100.
Everything else you write is correct, though.

Joined: Dec 2002
Posts: 83
D
Babel fish
Offline
Babel fish
D
Joined: Dec 2002
Posts: 83
mIRC increment the $cid each time you open a new status window, server connected or not.

So the difference between scid and scon is the following :
scid make reference to the $cid of the connection
scon make reference to the position in the switchbar. If the server is in second position, its connection position is number 2, so its identity connection (cid) is $scon(2) and for reaching this is, you make $scid($scon(2)).
If you close a status window (quit a server), the scon is each time refreshed to its new position. But the $cid is never reevaluated because it is a specific identity for this window (same as HWND in windows)


Link Copied to Clipboard