From WikiChip
Difference between revisions of "mirc/on events/on hotlink"
< mirc‎ | on events

(Created On hotlink event - mIRC)
 
m (Examples)
Line 40: Line 40:
 
   halt
 
   halt
 
}
 
}
ON *:HOTLINK:*hoverme*:*:echo -a Hotlink: $1 - Hotlink line: $hotline - Hotlink line Position: $hotlinepos</source>
+
ON *:HOTLINK:*hoverme*:*:echo -a Hotlink: $1 - Hotlink line: $hotline - Hotlink line and Word Position: $hotlinepos</source>
  
 
Upon hovering over the word ''hoverme'' as shown in the above example, the following resembles the output:
 
Upon hovering over the word ''hoverme'' as shown in the above example, the following resembles the output:
<pre>Hotlink: hoverme - Hotlink line: hoverme - Hotlink line Position: 1 269</pre>
+
<pre>Hotlink: hoverme - Hotlink line: hoverme - Hotlink line and Word Position: 1 269</pre>
  
 
== Compatibility ==
 
== Compatibility ==

Revision as of 02:02, 25 June 2014

The ON HOTLINK event allows the targeting of certain words to create mouse hover, or double-clickable link events for.

This event fills the $hotline and $hotlinepos identifiers with both the entire line of text, and the position in the text the link appears, respectively. The $1 identifier is also filled with the hotlink matchtext that triggered the event in the first place.

The ON HOTLINK event is very intensive, in that it monitors and tracks all mouse movements, and therefore any commands which the event triggers must be as quick, efficient, and small as possible. The reason behind this command minimalistic nature is simply because the event runs every time, and therefore tries to keep up in real-time. If the commands are too large, or process-intense, mIRC will begin to lag a great deal.

Synopsis

ON <level>:HOTLINK:<matchtext>:<*#?=!@>:<commands>

Parameters

<level>The level for the event to trigger.

<matchtext>The text that to be matched. Can also be a wildcard.

<*#?=!@>The window type that this event should monitor.

*Any window
#Any channel, or specific channel name(s)
?Query windows
=DCC Chat windows
!Fserve windows
@Custom windows

<commands>The commands to be performed when the event listener's criteria is met.

Examples

Monitor all windows for both the text 'hoverme' and echo to the active window that the word was hovered:

ON *:HOTLINK:*hoverme*:*:echo -a $1 was just hovered!

The next example has 2 events. One contains an ^ prefix, which signifies elevation. This event will stop all hotlinks if the criteria set is not met. However, if criteria is met, and a match is made, the hotlink will become clickable (this is apparent when the mouse cursor becomes the hand-pointer).

The second event allows the double-click feature to return some information about the hotlink:

ON ^*:HOTLINK:*hoverme*:*:{
  if ($1 == hoverme) return
  halt
}
ON *:HOTLINK:*hoverme*:*:echo -a Hotlink: $1 - Hotlink line: $hotline - Hotlink line and Word Position: $hotlinepos

Upon hovering over the word hoverme as shown in the above example, the following resembles the output:

Hotlink: hoverme - Hotlink line: hoverme - Hotlink line and Word Position: 1 269

Compatibility

Added: mIRC v5.61

Added On: 23/09/99

See Also