mIRC Home    About    Download    Register    News    Help

Topic Options
#222318 - 16/06/10 04:42 PM 7.05 Scid behaviour not working right
StrawberryKitty Offline
Ameglian cow

Registered: 04/06/09
Posts: 48
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.


Edited by StrawberryKitty (16/06/10 04:43 PM)

Top
#222319 - 16/06/10 05:06 PM Re: 7.05 Scid behaviour not working right [Re: StrawberryKitty]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3465
Loc: France
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


Edited by Wims (16/06/10 05:07 PM)
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#222320 - 16/06/10 05:24 PM Re: 7.05 Scid behaviour not working right [Re: Wims]
drum Offline
Fjord artisan

Registered: 08/12/02
Posts: 339
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".)

Top
#222328 - 16/06/10 11:22 PM Re: 7.05 Scid behaviour not working right [Re: Wims]
StrawberryKitty Offline
Ameglian cow

Registered: 04/06/09
Posts: 48
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?

Top
#222329 - 16/06/10 11:41 PM Re: 7.05 Scid behaviour not working right [Re: StrawberryKitty]
argv0 Offline
Planetary brain

Registered: 13/10/03
Posts: 3918
Loc: Montreal, QC, Canada
Is this issue specific to 7.05? Does this not happen in 6.35? or 7.04?
_________________________
- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Top
#222332 - 17/06/10 12:47 AM Re: 7.05 Scid behaviour not working right [Re: StrawberryKitty]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3465
Loc: France
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.


Edited by Khaled (17/06/10 10:22 AM)
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#222336 - 17/06/10 10:47 AM Re: 7.05 Scid behaviour not working right [Re: Wims]
Khaled Offline


Planetary brain

Registered: 04/12/02
Posts: 4344
Loc: London, UK
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.

Top
#222343 - 17/06/10 02:19 PM Re: 7.05 Scid behaviour not working right [Re: Khaled]
StrawberryKitty Offline
Ameglian cow

Registered: 04/06/09
Posts: 48
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 ._.


Edited by Khaled (18/06/10 03:19 PM)

Top