mIRC Home    About    Download    Register    News    Help

Topic Options
#127514 - 14/08/05 11:40 AM new status window
da_hype Offline
Vogon poet

Registered: 29/02/04
Posts: 119
Loc: Logan, Utah (USA)
how do i detect if a new status window is opened and it's not connected yet?

Top
#127515 - 14/08/05 12:45 PM Re: new status window
FiberOPtics Offline
Hoopy frood

Registered: 05/02/04
Posts: 2019
Loc: Leuven, Belgium
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.

Top
#127516 - 14/08/05 12:50 PM Re: new status window
da_hype Offline
Vogon poet

Registered: 29/02/04
Posts: 119
Loc: Logan, Utah (USA)
like this????

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

Top
#127517 - 14/08/05 12:54 PM Re: new status window
FiberOPtics Offline
Hoopy frood

Registered: 05/02/04
Posts: 2019
Loc: Leuven, Belgium
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.

Top
#127518 - 14/08/05 12:57 PM Re: new status window
da_hype Offline
Vogon poet

Registered: 29/02/04
Posts: 119
Loc: Logan, Utah (USA)
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
}


Edited by da_hype (14/08/05 12:57 PM)

Top
#127519 - 14/08/05 01:01 PM Re: new status window
FiberOPtics Offline
Hoopy frood

Registered: 05/02/04
Posts: 2019
Loc: Leuven, Belgium
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.

Top
#127520 - 14/08/05 01:28 PM Re: new status window
da_hype Offline
Vogon poet

Registered: 29/02/04
Posts: 119
Loc: Logan, Utah (USA)
thanks. got it...
srry kind of slow.. (6:30am here)

Top