Color Trigger Question

Talkslowtome
Posts: 21
Joined: Tue Jun 17, 2014 10:17 pm

Color Trigger Question

Post 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?

User avatar
demonnic
Posts: 884
Joined: Sat Dec 05, 2009 3:19 pm

Re: Color Trigger Question

Post 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.

Talkslowtome
Posts: 21
Joined: Tue Jun 17, 2014 10:17 pm

Re: Color Trigger Question

Post by Talkslowtome »

Thank you. I'm gonna test it out and hopefully I'll do it right.

User avatar
demonnic
Posts: 884
Joined: Sat Dec 05, 2009 3:19 pm

Re: Color Trigger Question

Post 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 =)

Talkslowtome
Posts: 21
Joined: Tue Jun 17, 2014 10:17 pm

Re: Color Trigger Question

Post 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?

User avatar
demonnic
Posts: 884
Joined: Sat Dec 05, 2009 3:19 pm

Re: Color Trigger Question

Post 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()

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Color Trigger Question

Post 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.

Talkslowtome
Posts: 21
Joined: Tue Jun 17, 2014 10:17 pm

Re: Color Trigger Question

Post 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.)

Fenwryches
Posts: 6
Joined: Thu Jun 12, 2014 11:15 pm

Re: Color Trigger Question

Post by Fenwryches »

It should work fine. Try ticking off the highlight in the trigger.

Talkslowtome
Posts: 21
Joined: Tue Jun 17, 2014 10:17 pm

Re: Color Trigger Question

Post by Talkslowtome »

Bingo! Thank you!

Post Reply