Thanks in advance for the help. I'm guessing this is obvious and simple to you experienced folks. And I'm searching for the wrong terms.
I have a variable full of strings. I want to make them red.
Simple text highlight triggers are no problem. Regex is a work in progress. But I can't figure out where/how to insert the variable.
Thanks again,
Josh
Pattern matching a variable
Re: Pattern matching a variable
How about an alternative approach - check out https://wiki.mudlet.org/w/Manual:Script ... _target.3F. Does that work?
Re: Pattern matching a variable
I saw that and don't understand it.
How do you highlight Mud output with an alias? Triggers respond to Mud output. Aliases respond to user input. Right?
What is "id"? Is that a built in function? I tried using a function, but I still needed a way to trigger it.
Thanks for the help,
Josh
How do you highlight Mud output with an alias? Triggers respond to Mud output. Aliases respond to user input. Right?
What is "id"? Is that a built in function? I tried using a function, but I still needed a way to trigger it.
Thanks for the help,
Josh
Re: Pattern matching a variable
So, assuming you don't have too many things you want to highlight, you could do something like this, put into a function called via a Lua function type trigger (which calls the function for each line coming from the game):
Or, for a more comprehensive strategy, using triggers to highlight each target string (which will be faster, but the speed will only really be noticed if you have a large enough number of strings to highlight), you can do something like this:
This creates an "add highlight" alias that you can use to add a new string to highlight (though it won't be saved when you quit, so you will want to add it to the list manually if you want to keep that highlight around), and it will take care of making the necessary triggers whenever you connect to the game.
Re: Pattern matching a variable
In addition to Jor'Mox, if you look closely at that alias, you'll see that it uses tempTrigger() - so the alias actually creates a temporary trigger, which then when matched, highlights the word.jwrobbs wrote: ↑Sat Sep 23, 2017 12:10 pmI saw that and don't understand it.
How do you highlight Mud output with an alias? Triggers respond to Mud output. Aliases respond to user input. Right?
What is "id"? Is that a built in function? I tried using a function, but I still needed a way to trigger it.
Thanks for the help,
Josh
Re: Pattern matching a variable
Bingo!
While I'm sure all of this is very helpful (I need to dig through it a bit), the fact that the function checks every line is the key bit I was missing.
Thanks a million.
Looks like I'll need to spend some time on Code Combat figuring out Lua. Thanks again.
Re: Pattern matching a variable
So I'm giving Mudlet another try and I'm giving this problem another try. But it still doesn't make sense.
I have a variable with 1 value (target = bob). I want that to have a specific style. I tried pasting that script into a Lua function and it gives me errors. You can't put the script in the place of the pattern. And you have to have a pattern so adding the code at the bottom doesn't work either.
What am I missing?
Re: Pattern matching a variable
What you would do is make a script, with the code like so:
And then put this as the pattern: do_highlight()
Re: Pattern matching a variable
Now I think it makes sense.
You set the trigger to function and call the function from the pattern. The function itself goes in scripts.
Thanks for the help!
You set the trigger to function and call the function from the pattern. The function itself goes in scripts.
Thanks for the help!