$query
From Scriptwiki
Returns information about open query windows on the current active connection.
$query(name|N)[.addr|.logfile|.stamp|.wid|.cid|.hwnd]
- Name is the name of the query window (Or the nick of the user the query is with). N specifies the Nth query window, if N=0 returns the total number of open query windows.
- Returns
- For no property, returns the name of the window.
- .addr returns the address of the user based address of the user t he last time he sent you a query. Note: If no messages were received, no address will be available.
- .logfile returns the logfile associated with this query window.
- .stamp returns $true or $false based on whether or not timestamps are enabled.
- .wid returns the window id.
- .hwnd returns the window handle.