mIRC Home    About    Download    Register    News    Help

Print Thread
Reverse look ups on $wid. #94150 14/08/04 10:58 AM
Joined: Aug 2004
Posts: 4
D
DrGamut Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Aug 2004
Posts: 4
How do you return the name of a window using its $wid?

Or for that matter, how do you return the name of the window relevant to the executing script/event?

Last edited by DrGamut; 14/08/04 11:03 AM.
Re: Reverse look ups on $wid. #94151 14/08/04 01:33 PM
Joined: Dec 2002
Posts: 774
T
theRat Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
$active


Code:
//if ( khaled isgod ) echo yes | else echo no
Re: Reverse look ups on $wid. #94152 17/08/04 12:19 PM
Joined: Aug 2004
Posts: 4
D
DrGamut Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Aug 2004
Posts: 4
Wrong. $active refers to the window that is currently on top in mIRC, not necessarily the window that triggered the script.

$target's closer than $active is, but still not what I need.

Re: Reverse look ups on $wid. #94153 17/08/04 12:20 PM
Joined: Dec 2002
Posts: 266
Z
zack Offline
Fjord artisan
Offline
Fjord artisan
Z
Joined: Dec 2002
Posts: 266
$target should work fine. If you're having issues with query windows, just use $iif($target ischan,$chan,$nick).


You won't like it when I get angry.
Re: Reverse look ups on $wid. #94154 18/08/04 09:05 AM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Try this:
Code:
wid2name {
  var %i = 1
  while $window(*,%i).wid {
    if $v1 == $1 { return $window(*,%i) }
    inc %i
  }
}
Example: //echo -a $wid2name(15)


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com