Added in 1.8.10
$target
Returns the target window for an [[Scripting_Events|event].
#channel/nick/Status Window
Example
; Print target window for a new incoming message. on *:TEXT:*:*:echo -ag Target window is $target