Hey, im wanting to highlight my TARGET variable a certain color so I can better see it when im hunting etc but i can only set it so it captures Goblin or goblin, not if its them both, im using title().. any clue how I can change it to capture both caps and no caps?
if i use lower() it only captures 'goblin' and title() only captures 'Goblin' ....
-----------------------------
target = string.title(matches[2])
if id then
killTrigger(id) end id = tempTrigger(target, [[selectString("]] .. target .. [[", 1) fg("gold") resetFormat()]])
--------------------------------------
is what im using..
Highlighting one Variable
Re: Highlighting one Variable
There are multiple solutions to your problem, but one of the simplest is I think using an case insensitive regex.
For example:
Good luck, G.
For example:
will work for patterns like Orc, oRc, ORC, etc.
Good luck, G.
Re: Highlighting one Variable
hmm no offense but that made no sense :/
Re: Highlighting one Variable
In what way? Do you want the exact code you need to solve your problem? Which part of my explanation is too convoluted?
What I suggested was simply replacing your tempTrigger with tempRegexTrigger and beforehand adding a (?i) in front of the targets name.
If you need more info on regular expressions there are tutorials on the web. If you think this solution is too complex then you may simply create two tempTriggers, one for uppercase, the other for lowercase.
Once again, good luck, G.
What I suggested was simply replacing your tempTrigger with tempRegexTrigger and beforehand adding a (?i) in front of the targets name.
If you need more info on regular expressions there are tutorials on the web. If you think this solution is too complex then you may simply create two tempTriggers, one for uppercase, the other for lowercase.
Once again, good luck, G.
Re: Highlighting one Variable
noo I did what you said, but its not highlighting the lower case names.... my code does go into an Alias... alo the 'target' is a variable, not a 'name' ....
Re: Highlighting one Variable
I would have to see your modified code to answear as to why it is not working but my guess would be that the coloring code also needs to be changed - try selecting the matches of the temporary trigger instead of the target variable - remember that the match might be upper or lower case.
As to my use of "name" - i was referring to the targets name such as "orc", "goblin" or whatever the target variable is set to. Adding "(?i)" in front of targets value tells the regex trigger to ignore character case.
As to my use of "name" - i was referring to the targets name such as "orc", "goblin" or whatever the target variable is set to. Adding "(?i)" in front of targets value tells the regex trigger to ignore character case.
Re: Highlighting one Variable
if id then
killTrigger(id) end id = tempRegexTrigger("(?i)" .. target, [[selectString("]] .. target .. [[", 1) fg("gold") resetFormat()]])
-- was what I changed it too...
killTrigger(id) end id = tempRegexTrigger("(?i)" .. target, [[selectString("]] .. target .. [[", 1) fg("gold") resetFormat()]])
-- was what I changed it too...
Re: Highlighting one Variable
Try replacing selectString("]] .. target .. [[", with selectString(matches[2],
Re: Highlighting one Variable
ok now im really confused.. replace what with what this is just going round in circles I'll just keep it as it is...
thanks anyway
thanks anyway
Re: Highlighting one Variable
Right, it seems suggestions are not the way to go. No problem. Here is the full solution, simply paste this in:
Good luck, G.