$target
Indice
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
- mIRC Installation
- Virtual profile
- Playing music
- Unicode
- IPv6
- Optimization
- Threads
- DCC Protocols
- Line Lenght Limit
- Font rendering”)
$target returns the target of an event. For instance, when a window closes, the on close event triggers and $target is filled with the window name of that window.
Contents
Synopsis
$target
Parameters
None
Properties
None
Examples
; When any window is closed, echo the window name
; to a custom @windowWatcher window. If that window doesn't exist,
; create it first.
ON *:CLOSE:*: {
$iif(!$window(@windowWatcher),window @windowWatcher)
echo @windowWatcher Window Closed: $target $+ .
}
; When a message is received in a query,
; open a new @window with the user's nickname and log the
; chat from there on out. If the window closes, stop logging.
ON *:OPEN:?:*: {
; Add the user to level 3 for logging
.auser 3 $address($nick,2)
; Set the window name to the dynamic $target identifier
%w = @ $+ $target
; If the custom logging window is not open, create and
; minimize it.
if (!$window(%w)) { window -n %w }
; If the user has sent data, log it to the custom window
if ($1) { echo %w $1- }
}
ON 3:TEXT:*:?: {
; Set the window name to the dynamic $target identifier
var %w = @ $+ $target
; If the custom logging window is not open, create and
; minimize it.
if (!$window(%w)) { window -n %w }
; Echo the contents of the message to the window.
echo %w $1-
}
ON 3:CLOSE:?: {
; When the query window is closed locally or remotely,
; remove the user from the user level 3 for logging,
.ruser 3 $address($target,2)
; Input a request if the log window should be kept open
; or closed.
window $iif($input(Do you want to keep the log window open?,yi,Keep Log Window?),-a,-c) @ $+ $target
}
Compatibility
Added: mIRC v5.3
Added on: 13 Dec 1997
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.
See also
mIRC identifier list