mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2018
Posts: 4
P
Self-satisified door
OP Offline
Self-satisified door
P
Joined: Nov 2018
Posts: 4
mIRC succeccfully recognises URLs when the protocol is connected to another word, e.g. "https://google.com" is hover-able and click-able in "wordhttps://google.com". I cannot figure out how to recreate this behaviour, however.

As an example, I would like to match a single character inside a word. "e" should act as a hotlink in the word "hello", but "h" and "llo" should not. Is this possible?

A regex match captures the character easily, but the on HOTLINK event always matches the entire word, regardless.

Last edited by PineappleJerky; 09/11/18 02:12 AM.
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Do you have any code currently?

Last edited by Wims; 09/11/18 03:44 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Nov 2018
Posts: 4
P
Self-satisified door
OP Offline
Self-satisified door
P
Joined: Nov 2018
Posts: 4
These examples explain no more than my original post, but here are some that do not do what I want:

Code:
on ^*:HOTLINK:*e*:*:{}

on HOTLINK will match all of the following: "e", "he", "ello" and "hello".

Code:
on $^*:HOTLINK:/(e)/:*:{}

$regml(1) will return "e" when it finds the word "hello", but $1 and $hotlink(match) will return "hello". The entire word "hello" will be 'hover-able' (the mouse turns into a pointing hand).

Last edited by PineappleJerky; 09/11/18 04:18 PM.
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Ok, so it seems it's not possible to do this currently. on hotlink was meant to match on word, and there's no way currently to know what is the character under the mouse cursor.

However, the built-in hotlink feature is able to do that, I'm fairly certain that it should be possible for the on hotlink event to report such an information, but Khaled has stated that the built-in hotlink feature and the on hotlink event are different: https://forums.mirc.com/ubbthreads.php/ubb/showflat/Number/262119/ & https://forums.mirc.com/ubbthreads.php/ubb/showflat/Number/262120/

I'd still ask for it in the feature suggestions forum.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
I'm seeing what you describe. Also, $hotlinepos also returns the location of the beginning of the entire word. So you can identify which word containing e triggered the match, and $regml(1).pos returns the position within the word of the first match.

Joined: Nov 2018
Posts: 4
P
Self-satisified door
OP Offline
Self-satisified door
P
Joined: Nov 2018
Posts: 4
Thanks, chaps

Edit for anyone following: Suggested here

Last edited by PineappleJerky; 10/11/18 12:13 AM.

Link Copied to Clipboard