mIRC Home    About    Download    Register    News    Help

Topic Options
#264202 - 09/11/18 02:12 AM on HOTLINK - Partial word match?
PineappleJerky Offline
Self-satisified door

Registered: 09/11/18
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.


Edited by PineappleJerky (09/11/18 02:12 AM)

Top
#264205 - 09/11/18 03:14 PM Re: on HOTLINK - Partial word match? [Re: PineappleJerky]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3435
Loc: France
Do you have any code currently?


Edited by Wims (09/11/18 03:44 PM)
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#264206 - 09/11/18 03:48 PM Re: on HOTLINK - Partial word match? [Re: Wims]
PineappleJerky Offline
Self-satisified door

Registered: 09/11/18
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).


Edited by PineappleJerky (09/11/18 04:18 PM)

Top
#264207 - 09/11/18 05:20 PM Re: on HOTLINK - Partial word match? [Re: PineappleJerky]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3435
Loc: France
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.
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#264208 - 09/11/18 05:40 PM Re: on HOTLINK - Partial word match? [Re: PineappleJerky]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 966
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.

Top
#264210 - 09/11/18 09:07 PM Re: on HOTLINK - Partial word match? [Re: PineappleJerky]
PineappleJerky Offline
Self-satisified door

Registered: 09/11/18
Posts: 4
Thanks, chaps

Edit for anyone following: Suggested here


Edited by PineappleJerky (10/11/18 12:13 AM)

Top