mIRC Home    About    Download    Register    News    Help

Print Thread
#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.
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
$active


Code:
//if ( khaled isgod ) echo yes | else echo no
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.

Joined: Dec 2002
Posts: 266
Z
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.
Joined: Jan 2003
Posts: 2,523
Q
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

Link Copied to Clipboard