mIRC Home    About    Download    Register    News    Help

Print Thread
new status window #127514 14/08/05 10:40 AM
Joined: Feb 2004
Posts: 119
D
da_hype Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Feb 2004
Posts: 119
how do i detect if a new status window is opened and it's not connected yet?

Re: new status window #127515 14/08/05 11:45 AM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
I forgot about it but now that you mention it you can use $status to see if it's "connecting".

You can detect when a window is activated, and check if it's a "status window", since the /server command always sets focus to the new status window.

You can then check if the $cid of the status window is a new one or not, by keeping the value of the last $cid in a variable.


Gone.
Re: new status window #127516 14/08/05 11:50 AM
Joined: Feb 2004
Posts: 119
D
da_hype Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Feb 2004
Posts: 119
like this????

Code:
on *:active: { 
  if ($window(status window)) && (!$status) echo -a not connected
}

Re: new status window #127517 14/08/05 11:54 AM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Close, but $status will either say:

disconnected, connecting, or connected.

So if (!$status) will always be $false.

So in the case of a new status window, if it's not connected yet $status will have value disconnected, so you should check for that.


Gone.
Re: new status window #127518 14/08/05 11:57 AM
Joined: Feb 2004
Posts: 119
D
da_hype Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Feb 2004
Posts: 119
LOL. don't understand what u're talking about. then how am i suppose to detect when a new status window is opened???

even this don't return anything
Code:
on *:active: { 
  if ($window(status window)) echo -a not connected
}

Last edited by da_hype; 14/08/05 11:57 AM.
Re: new status window #127519 14/08/05 12:01 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
if ($active == status window) ...

You can check if the $cid of the new active status is higher than the last opened $cid. Then you know if it's a newly openened window. You then save the value of this $cid as last one, and so on.

Aren't you the author of a full script, with all sorts of whistles and bells? This should be a walk in the park...

EDIT:

First type //set %lastcid $scon($scon(0)).cid

Code:
on *:active:*:{
  if ($active == status window) && ($cid > %lastcid) {
    inc %lastcid 
    echo -a New status window: $status
  }
}
on *:start: set %lastcid 1



Gone.
Re: new status window #127520 14/08/05 12:28 PM
Joined: Feb 2004
Posts: 119
D
da_hype Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Feb 2004
Posts: 119
thanks. got it...
srry kind of slow.. (6:30am here)