$wid
From Scriptwiki
Returns the window ID the current script is focused on.
$wid
- This identifier has no properties or parameters.
The Window ID can be used in /window by using @N as the window name, where N is the window ID. It can also be used in /setlayer