So I've finally decided I'm tired of not having my target highlighted. I'm using a very very simple targeting alias right now which is this.
Pattern: ^tar (.+)$
target = matches[2]
echo("Target is now: " ..target)
What I'd like to know how to do, is have it so that whenever I see the word that I have targetted, whether it's in tells, room descriptions or even the echo on my targeting alias, the letters are red.
I also want to point out that I am as new to LUA and Mudlet coding as you can be, really. Used Zmud and Cmud for years, so if you want me to understand anything, you'll have to explain.
Viva la Bluef.
0
Comments
Viva la Bluef.
Viva la Bluef.
and similar for target_low, so you'll stop highlighting your old target when you switch.
Results of disembowel testing | Knight limb counter | GMCP AB files
FWIW, you don't need the extra parentheses around target:lower() - target:lower():title() works just fine. And in case you or anyone else is interested, you can use string.format to avoid the concatenation operators (..), like
which I find considerably more readable, especially for cases where you want to sub in multiple variables.
or something else?
Just underneath them both? I know I'll have to add a second for target_low as well
Viva la Bluef.
target = whatever
killtrigger
highlight
should be the order.
That's how I've got it set. I'm not noticing any problems, and I've double checked to see if the old targets are still highlighted, and they're not. See anything wrong?
Viva la Bluef.
ds_tar = matches[2]:title()
output("<LightSkyBlue>Target set to <pink>" .. ds_tar .. "<LightSkyBlue>.")
if target_upper then killTrigger(target_upper) end
target_upper = tempTrigger(ds_tar, [[highlightTarget("]]..ds_tar..[[")]])
if target_lower then killTrigger(target_lower) end
target_lower = tempTrigger(ds_tar:lower(), [[highlightTarget("]]..ds_tar:lower()..[[")]])
Viva la Bluef.