mIRC Homepage
Posted By: DrainBamaged when opening a @window - 13/04/03 02:41 AM
in the help file it reads:


on 1:CLOSE:@:/echo -s Just closed $target custom window

The above triggers when a custom window is closed. The OPEN event does not trigger for custom windows.


what i need is a substitute for the open @window event, since you cannot get it with 'on'.

any ideas?
Posted By: Nimue Re: when opening a @window - 13/04/03 03:52 AM
Code:
alias window {
  if $isid { return }
  var %a = $wildtok($1-,@*,1,32)
  if !$window(%a) { .signal windowopen %a }
  !window $1-
}
on *:signal:windowopen:{
  echo -a Here is a substitute 'on open' event for $1
}
Posted By: DrainBamaged Re: when opening a @window - 13/04/03 03:57 AM
thats good, but a few problems occured.

1) it doesn't work with /debugs (it only works for actually /windows). is there anything i could change/add so all custom windows are supported?

2) it counts for all windows, not just custom windows. what i mean by this is that if i use that echo, it will appear on all windows i click on (channel, query, etc.). is there anything i can do about this?
Posted By: Nimue Re: when opening a @window - 13/04/03 04:04 AM
A slight mod to only trigger if window command succeeds. If the /window command fails it will halt with the error (e.g. "* /window: invalid parameters") and not trigger the signal.
Code:
alias window {
  if $isid { return }
  var %a = $wildtok($1-,@*,1,32),%b = $window(%a)
  !window $1-
  if !%b { .signal windowopen %a }
}
on *:signal:windowopen:{
  echo -a Here is a substitute 'on open' event for $1
}


"only one problem; it doesn't work with /debugs "
alias debug { blahblah... } smile
Posted By: Nimue Re: when opening a @window - 13/04/03 04:09 AM
"is there anything i can do about this?"
Code:
  if %a && !%b { .signal.... }
Posted By: DrainBamaged Re: when opening a @window - 13/04/03 04:09 AM
nvm this post. we were posting our msg's at the same time, so you answered my question. thanks for all your help laugh
© mIRC Discussion Forums