I've been making progress on creating a system for Mudlet, with the help of you forum goers and the development team.
As was brought up in another thread, I make liberal use of highlighting triggers and I would like to be able to create/use functional, correctly highlighting triggers with Mudlet. Currently I've been trying to create an 'enemies name' highlighter. The key requirements of this for me are:
- Must be quick. IE, no taking over a minute to highlight names
- Highlight multiple names, occurrences of one name, on a line
- ONLY Highlight the name, not the name if it's part of another name/word
- Must be able to add and remove names/highlighting from the list easily
This is the code for the alias to load the table, and create the tempTriggers for the names highlighting.
I originally was using tempRegexTrigger() for the creation of the names, as I could put in a word boundary into the regex to be sure it matched on ONLY that name. IE (\benemyname\b). However, matching with those 1800 rexex triggers was.... slow. Very slow. So, upon advice from Vadi and the manual, I changed to using tempTrigger(). However, now some names are not highlighting on a line in one instance, but ARE highlighting in another. Also, by using this tempTrigger() instead of a RegEx, the word is highlighted even if its contained in ANOTHER word (not, what I want to happen).
For the first instance: Xan is an enemy. There is a temporary trigger that is suppose to highlight the name. On one line, (After 'Enemies of the City of Mhaldor') his name is NOT highlighted. However, on the line after the next prompt, when I pull up information on the character, his name IS highlighted.
What would cause this to occur, and how can I get the highlighting to be consistent?
On the second instance: Phae is an enemy. I want her NAME highlighted, IE only if it's exactly 'Phae' not anything else. On the last line before the the prompts, you'll see that there is a line 'Penned by my hand on the 4th of Phaestian, in the year 533 AF.' where the 'Phae' in 'Phaestian' is highlighted. I would like for this to NOT occur.
I know what's causing this, the trigger matching for a 'substring' is highlighting any occurrence of the word without respect to a word boundary. Short of using regular expressions for these triggers, is there anything I can do to force an 'exact match' or a matching only with word boundaries for tempTrigger?
Thank you.