The on ACTIVE and on APPACTIVE events trigger when a window in mIRC is activated or when its active status changes.
Format: on <level>:ACTIVE:<*#?=!@>:<commands>
Example: on 1:ACTIVE:#mirc:/echo Channel window #mIRC has been activated
on 1:ACTIVE:*:echo Activated: $active De-Activated: $lactive
The above event triggers whenever a window in mIRC is activated. The $active identifier returns the name of the currently active window, and the $lactive identifier returns the name of the window that was just de-activated. You can also use the $activecid and $lactivecid, see the Multi-Server section for more information.
Note: It is possible for either or both $active and $lactive to return $null.
on 1:APPACTIVE:echo mIRC active status: $appactive
The above event triggers when the active status has changed. The $appactive identifier returns $true if mIRC is active, or $false if it is not.