mIRC Homepage
Basically in one of my scripts I am doing this:

Code:
//scid 1 if ($window(Status Window).state != maximized) { echo 4 -a yes }


And it's showing a yes on $cid 2 problem is the window on $cid 1 is actually maximised so nothing should happen.
Posted By: Wims Re: 7.05 Scid behaviour not working right - 16/06/10 04:06 PM
You seem to misunderstand /scid and /scon, /scon N use the Nth connexion, /scon 1 use the first connexion, /scon 2 the second etc.
For /scid it's completely different, each connexion has an associated number called connexion id, it can be anything, you should never assume the first connexion has a connexion id of 1.

Also, note that /scon and /scid double evaluate their parameters, in your case it's working because you only have one command, when mirc see the condition, it just see :
Code:
if ($window(Status Window).state != maximized) echo 4 -a yes
because the { and } has been evaluated
Code:
//scid 1 if ($window(Status Window).state != maximized) { echo 4 -a yes | echo -a yeah }
would not work as expected
Posted By: drum Re: 7.05 Scid behaviour not working right - 16/06/10 04:24 PM
Just to expand on what Wims has said, I'd suggest that when using the /scon or /scid, you should use it in one of two ways:

1.) Use "/scid N somealias" then make an alias "/somealias" to do what you want. This will avoid a few of the problems that are harder to anticipate.

2.) Use "/scid N", then on the next line do your if statement. (If you want to return to the original cid after that, you need to use "/scid -r".)
Code:
//scon 1 if ($window(Status Window).state != maximized) echo 4 -a yes


This code does the same thing as /scid, so is this a bug?
Posted By: argv0 Re: 7.05 Scid behaviour not working right - 16/06/10 10:41 PM
Is this issue specific to 7.05? Does this not happen in 6.35? or 7.04?
Posted By: Wims Re: 7.05 Scid behaviour not working right - 16/06/10 11:47 PM
Ah, I see your problem now, the value of $window(status window).state is "normal" while you expect "maximized".
It is a bug for me, I can reproduce this on 6.35.
Posted By: Khaled Re: 7.05 Scid behaviour not working right - 17/06/10 09:47 AM
It looks like this issue is related to the $window().state property, not /scid or /scon.

mIRC is actually reporting the window state correctly in this case. This is due to the way MDI windows work. When an MDI window is maximized, all other windows in the MDI container are changed to a non-maximized state by Windows. Only when the window becomes active is it set back to a maximized state.

I could make mIRC return a fake state value for a window if 1) the top, active window is maximized, and 2) the window you are checking is in a visible, restored state. That would resolve the issue, however it would not be returning the actual window state.
Yay Khaled, basically I was trying to fix odd behaviour in mIRC, I get some race condition that is breaking my script that I try very hard to work around. Anyway this should help...

I have mIRC set to startup with windows and when it does I get this.



Code:
Script:
on *:START: {
  scon 1 echo 4 @console Debug (active):2 $active
  scon 1 echo 4 @console Debug (network):2 $network
  scon 1 echo 4 @console Debug (cid):2 $cid
  scon 1 echo 4 @console Debug (server):2 $server
}

Output:
Debug (active):
Debug (network): Quakenet
Debug (cid): 1
Debug (server):


If I close mIRC and I restart it. It shows up normally with the first connection window as displaying. Here's what it's like when I restart it once my PC has booted.



Code:
Script:
on *:START: {
  scon 1 echo 4 @console Debug (active):2 $active
  scon 1 echo 4 @console Debug (network):2 $network
  scon 1 echo 4 @console Debug (cid):2 $cid
  scon 1 echo 4 @console Debug (server):2 $server
}

Output:
Debug (active): Status Window
Debug (network): Quakenet
Debug (cid): 1
Debug (server):


I don't know what this is but it drives me nuts, but I'm close to making a script to make mIRC behave it's just taking lots of messing around so hoping you can fix it ._.
© mIRC Discussion Forums