mIRC Homepage
Posted By: PineappleJerky on HOTLINK - Match only partial word - 09/11/18 09:06 PM
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.
Posted By: Wims Re: on HOTLINK - Match only partial word - 09/11/18 11:04 PM
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.
© mIRC Discussion Forums