mIRC Homepage

$activewid

Posted By: greeny

$activewid - 24/02/06 06:18 PM

Add an identifier like $activewid that works like $active but returns the $wid of the currently active window.

$window($active).wid won't work for that since there can be multiple windows with the same name.
Posted By: jaytea

Re: $activewid - 24/02/06 09:17 PM

ya this would be a good addition, not that i currently need it, but only because it's not possible to script accurately (duplicate dcc windows of the same name for example) :X
Posted By: Jigsy

Re: $activewid - 24/02/06 09:32 PM

$lactivewid too
Posted By: qwerty

Re: $activewid - 25/02/06 12:02 AM

Agreed, it would be nice to have it built-in. In the meantime, here's a workaround:
Code:
alias activewid {
  var %i = 1
  while $window($active,%i).wid {
    var %w = @ $+ $v1, %c = $window(%w).sbcolor
    window -g1 %w
    if !$window(%w).sbcolor { return $mid(%w,2) }
    window -g $+ $calc($findtok(message highlight event,%c,32)) %w
    inc %i
  }
}
Posted By: greeny

Re: $activewid - 25/02/06 01:06 AM

Thanks qwerty, pretty clever smile
Posted By: DaveC

Re: $activewid - 25/02/06 05:10 AM

Agreed, very nice. (I have added this to my library of functions, even tho i dont currently have a use, better than trying to remember it later)

First use of a 6.17 addition i have seen, and solves the problem of $activewid with very little code being executed.

Not that you asked for it, but i cant really think of a use for $lactivewid, im sure there would be one, but i cant think of it.
Posted By: Jigsy

Re: $activewid - 25/02/06 07:26 PM

I kind of thought of this now ...

Code:
on *:active:*:{
  if ($lactive) { window -n $+(@,$lactivewid) }
  mdi -t
}


My current workaround ...

Code:
on *:active:*:{
  if ($lactive) {
    scid $lactivecid
    window -n $qt($lactive)
    scid $activecid
  }
  mdi -t
}
© 2022 mIRC Discussion Forums