From WikiChip
Editing mirc/on events/on hotlink

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
Line 11: Line 11:
  
 
$1 returns the word that matched, stripped from its control code.
 
$1 returns the word that matched, stripped from its control code.
 
+
'''Note''': $hotlink() can used to get the word that matched with control codes preserved.
'''Note''': $hotlink() can be used to get the word that matched with control codes preserved.
 
  
 
The event triggers for various mouse events: sclick, dclick, rclick, mouse, uclick, you can use {{mIRC|$hotlink|$hotlink()}} to get the mouse event as well as informations about the line number, the word position etc..
 
The event triggers for various mouse events: sclick, dclick, rclick, mouse, uclick, you can use {{mIRC|$hotlink|$hotlink()}} to get the mouse event as well as informations about the line number, the word position etc..
  
 
== Parameters ==
 
== Parameters ==
<span style="display: inline-block; width: 105px;">'''<level>'''</span>The corresponding {{mIRC|access levels}} for the event to trigger.
+
<span style="display: inline-block; width: 105px;">'''<level>'''</span>The level for the event to trigger.
  
 
<span style="display: inline-block; width: 105px;">'''<matchtext>'''</span>The text that to be matched. Can also be a {{mirc|wildcard}}.
 
<span style="display: inline-block; width: 105px;">'''<matchtext>'''</span>The text that to be matched. Can also be a {{mirc|wildcard}}.
Line 38: Line 37:
  
 
== Examples ==
 
== Examples ==
Monitor all windows for the a word matchting '*hoverme*' and echo to the active window the word that was hovered:
+
Monitor all windows for both the text 'hoverme' and echo to the active window that the word was hovered:
 
<source lang="mIRC">ON *:HOTLINK:*hoverme*:*:echo -a $1 was just hovered!</source>
 
<source lang="mIRC">ON *:HOTLINK:*hoverme*:*:echo -a $1 was just hovered!</source>
  
== Old on hotlink handling ==
+
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 event was revamped in mIRC 7.23, before, the event was working somewhat differently from others events:
 
  
<source lang="mIRC">
+
The second event allows the double-click feature to return some information about the hotlink:
on ^*:HOTLINK:*help*:#:{
+
<source lang="mIRC">ON ^*:HOTLINK:*hoverme*:*:{
if ($1 == helpme) return
+
  if ($1 == hoverme) return
halt
+
  halt
 
}
 
}
 +
ON *:HOTLINK:*hoverme*:*:echo -a Hotlink: $1 - Hotlink line: $hotline - Hotlink line and Word Position: $hotlinepos</source>
  
on *:HOTLINK:*:*:echo clicked word $1 in line $hotline $hotlinepos
+
Upon hovering over the word ''hoverme'' as shown in the above example, the following resembles the output:
</source>The first ^ event is triggered when you move your mouse over a word that matches *help* in a channel window. You can then check $1 to see if you want the hotlink hand to appear over the word. If you halt the event, no hand will appear. The second non-^ event is triggered when you double-click on a word which has been filtered through the first hotlink event.
+
<pre>Hotlink: hoverme - Hotlink line: hoverme - Hotlink line and Word Position: 1 269</pre>
 
 
This implementation was very limited and is deprecated, {{mirc|$hotline}} and {{mirc|$hotlinepos}} still work as they should with the new implementation but can be considered somewhat deprecated as the general {{mirc|$hotlink|$hotlink()}} now gathers all the precious informations.
 
  
 
== Compatibility ==
 
== Compatibility ==
Line 62: Line 58:
 
* {{mIRC|$hotline}}
 
* {{mIRC|$hotline}}
 
* {{mIRC|$hotlinepos}}
 
* {{mIRC|$hotlinepos}}
* {{mIRC|$hotlink}}
 
* {{mIRC|/hotlink}}
 
 
 
{{mIRC on event list}}
 
{{mIRC on event list}}
  
 
[[Category:mIRC on events|hotlink]]
 
[[Category:mIRC on events|hotlink]]

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)