FiberOPtics commented on a Page, /amsg & /ame  -  Jan 12, 2006

Oh btw, I forgot to mention, there is a HUGE mistake in your code.

$scon(0) returns the total amount of open server windows. Let\'s say this is 3.

You are looping from %t = 1 till 3 then, with %t being 1, 2, 3.

You then do: scid %t, which will set the active server window to the one that has as $cid the value %t.

BUT!!!

The $cid of a server window, is a gloval variable in mIRC internal\'s, that is not reset until you close mIRC. When you open a new server window, mIRC checks this value, increments it, and assigns the new value as the $cid to this server window.

Let me illustrate where I am going with this:

->You have 2 server windows open, with $cid\'s 1 and 2.
->You close server window 2, and then open a new one.
-> The new one now has $cid 3, but you still only have 2 server windows open, with $cid\'s 1 and 3.

Do you notice how when you are looping, you will try to do \"scid 2\" which will try to set the active connection to a server window that doesn\'t exist!

The trick here is not to use /scid, but to use /scon. /scid takes a $cid, whilst /scon takes a number that represents the N\'th window, which is what you are looking for.

In our example, when you do scon %c, it will set it to the second server window, which is the one with $cid 3.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.