mIRC Home    About    Download    Register    News    Help

Print Thread
on HOTLINK - Match only partial word #264209 09/11/18 09:06 PM
Joined: Nov 2018
Posts: 4
P
PineappleJerky Offline OP
Self-satisified door
OP Offline
Self-satisified door
P
Joined: Nov 2018
Posts: 4
As discussed here, it would be great to have the ability to match only partial words with the on HOTLINK event:

Quote:
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".

Quote:
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.

Re: on HOTLINK - Match only partial word [Re: PineappleJerky] #264211 09/11/18 11:04 PM
Joined: Jul 2006
Posts: 3,792
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,792
Some clarifications:

I thought that getting the character directly under the mouse cursor would solve your issue, you would check if that's equal to 'e' and if so make it hotlinks...
However that doesn't work for all situations: for example if you wanted to hotlink if you are on the last 't' of "test", checking the letter under the cursor would fail, you would need to check the letter + the position of the letter in the word.

Something like $hotlink(mouse) returning the letter under the cursor and $hotlink(mouse).pos to get the position of the letter in the matched word.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net