mIRC Home    About    Download    Register    News    Help

Print Thread
#143464 24/02/06 06:18 PM
Joined: Dec 2002
Posts: 230
G
greeny Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Dec 2002
Posts: 230
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.

#143465 24/02/06 09:17 PM
Joined: Feb 2006
Posts: 523
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 523
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


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
#143466 24/02/06 09:32 PM
Joined: Nov 2004
Posts: 822
J
Hoopy frood
Offline
Hoopy frood
J
Joined: Nov 2004
Posts: 822
$lactivewid too

#143467 25/02/06 12:02 AM
Joined: Jan 2003
Posts: 2,125
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,125
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
  }
}

#143468 25/02/06 01:06 AM
Joined: Dec 2002
Posts: 230
G
greeny Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Dec 2002
Posts: 230
Thanks qwerty, pretty clever smile

#143469 25/02/06 05:10 AM
D
DaveC
DaveC
D
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.

#143470 25/02/06 07:26 PM
Joined: Nov 2004
Posts: 822
J
Hoopy frood
Offline
Hoopy frood
J
Joined: Nov 2004
Posts: 822
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
}


Link Copied to Clipboard