Page 1 of 2

Color Trigger Question

Posted: Tue Jun 17, 2014 10:28 pm
by Talkslowtome
Hi everyone,
I'm sure this has been asked before, but I failed to find it while searching.
As my name suggests, I need this explained really simply. (Let's call it a mild case of dyscalculia) It took me a year and several posts on the forums to get my zmud triggers set up. So, this is kind of daunting for me.

I can set up a simple color trigger in mudlet. It's been idiot proofed. My issue is that it will only highlight the words used to make the pattern.
For instance I might use green to know when I'm being hit. I set up a trigger with the words "hit's you" in the pattern.
Now the mud does this:
So and so hits you causing you to reel from the damage.
Great.
But how do I set up the mud to trigger on the phrase "hits you" and get it to do this:
So and so hits you, causing you to reel from the damage?

Re: Color Trigger Question

Posted: Tue Jun 17, 2014 10:40 pm
by demonnic
By default, it will only highlight the part it matches.

adding this to the trigger's script should help you out:
Code: [show] | [select all] lua
selectCurrentLine()
fg("green")
deselect()
resetFormat()
What this does is select the line the trigger has matched on, sets the foreground (or text) color to green, then clears the selection and resets format so your next triggers/lines come out looking as intended and you don't accidentally bleed into other text.

Re: Color Trigger Question

Posted: Tue Jun 17, 2014 11:43 pm
by Talkslowtome
Thank you. I'm gonna test it out and hopefully I'll do it right.

Re: Color Trigger Question

Posted: Wed Jun 18, 2014 12:09 am
by demonnic
You should be able to just copy and paste what I put into the big white box beneath the trigger patterns and then save it =)

Re: Color Trigger Question

Posted: Thu Jun 19, 2014 11:43 pm
by Talkslowtome
Something is wrong. I thought, I'll never be able to describe it. So, I took a screen shot. Image

Also, can you use custom colors for highlights?

Re: Color Trigger Question

Posted: Fri Jun 20, 2014 12:03 am
by demonnic
That does look like a bit of a display issue... did that happen from the copy/paste? If you click the button on the left in that screenshot which says "Errors" then it'll bring up an error console where you can see any lua scripts which have gone sideways.

As for custom colors, well sure... for this method, you have the following options:

Image

you can use bg("purple") in the same manner as fg("green") and replace the colors with whatever you wish from that chart.

There's further customization possible, but requires that you feed in your own RGB values, and I'm not sure if that's what you're looking for? If it is, you may want to look at setFgColor() and setBgColor()

Re: Color Trigger Question

Posted: Fri Jun 20, 2014 12:19 pm
by Jor'Mox
Also, if you wanted to, you can add your own color names to the color table, so you can use them that way. Like so:
color_table["my_color"] = {100,100,100} -- those are R G B color values respectively.

Re: Color Trigger Question

Posted: Fri Jun 20, 2014 10:03 pm
by Talkslowtome
Awesome tips on the custom colors. Still struggling with the full lines. But as promised, I have a bit of trouble processing. I'm not making some obvious connection. But... I don't know what it is, because, I'm not making that connection.
I wish there were an easy way to just import cmud settings and have it sort of imitate cmud. (Which may defeat the point as of course cmud imitates cmud very nicely. But since cmud is not really supported anymore and computers are changing I thought I should get ahead of the curve.)

Re: Color Trigger Question

Posted: Fri Jun 20, 2014 11:01 pm
by Fenwryches
It should work fine. Try ticking off the highlight in the trigger.

Re: Color Trigger Question

Posted: Sat Jun 21, 2014 12:08 am
by Talkslowtome
Bingo! Thank you!