Hey, new to Mudlet. Just re-started playing muds after over a decade off. I own zMud and am quite familiar with how things work, but it no longer works (and unsupported with Win 10 and I'm not paying again to play text games hah). I'm trying to figure how to trigger a color on various text options.
I have found some "answers", but it's in code (I'm assuming LUA?), and I've never coded with clients. Just clicked "this is what I want triggered" and then "this is what I want the trigger to do".
So I'm sitting at the triggers page and keep getting the message when I activate that no patterns are defined. Where do I define them? I managed to type in something once (and since deleted) and it said the trigger was activated, but the color never happened. From what I see, there's the options for name (name of the trigger that you define), send plain text (guessing that is if I wanted to run a command on the trigger?), then 0-6, which is um... what is actually done on the trigger? I don't know. I'm lost. Sadly the documentation on this topic wans't helpful at all. (The keybind was fantastic though!)
Basically, I'm trying to get the words (or line) "stands up" to be highlighted in red.
Thanks in advance.
Color triggers
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: Color triggers
Those numbered lines contain the incoming things that trigger the trigger - they can be of different types but the regexp type is the one you will most likely see discussed here (IMHO) because of the fun there is in expressing what you want to respond to and not to respond to. The "send plain text" box as you describe it is a "plain text response" to send straight back to the MUD server (IIRC) when it is triggered (there is no "processing" of it) OR you can write a script in the bottom area to respond to what was captured - and that is what uses the Lua language, with some Mudlet specific extra functions that interact with the application itself (see the Mudlet Lua API page of the Wiki linked to at the top right of this page).
Re: Color triggers
I've put "stands up" as my supposed trigger, but still only get
when I attempt to activate it.Trying to activate trigger New Trigger failed; reason: No patterns defined..
I was sane once. I got better.
Re: Color triggers
Looks like you may have specified a name but no pattern to match.tincan wrote:I've put "stands up" as my supposed trigger, but still only getwhen I attempt to activate it.Trying to activate trigger New Trigger failed; reason: No patterns defined..
for very simple triggers you can use the "send plain text" string marked as "simple action" in the above image.
For more complex things, like setting variables etc, you write the code in lua in the big textbox.
echo("You look around\n") -- show text on screen
send("look") -- send command to mud
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: Color triggers
Something put into the send plain text: "Simple action" entry is approximately equal to send("Something".."\n") in the "What to do (lua code)" area above.
Re: Color triggers
Thank you all for the advice, but it was just a little check box.
I'd noticed the "type" and kept choosing color trigger, which effectively erased my pattern. I only needed to check the "highlight" box.
I'd noticed the "type" and kept choosing color trigger, which effectively erased my pattern. I only needed to check the "highlight" box.
I was sane once. I got better.
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: Color triggers
Yeah, the colour is stored as a "F##B##" code in the "PATTERN" data for a trigger that matches on the colour of the incoming text and if you change a trigger from a colour one back to a different one you may see this!
<aside>I'm not sure whether it is tracking EITHER: the colour "number" index (typically 1 to 15) for the "normal" (for some values of normal) ANSI Set Graphics Rendition code {starts with ESC and ']' and ends with 'm' OR: what we decode those colours to be. If it is the latter it will make supporting 256-colour mode MUDs interesting as there are one or two duplicates in the range of 0-255 for the colour indexes, and there is nothing stopping the user setting two colours to be the same for the current 16-colour support...</aside>
<aside>I'm not sure whether it is tracking EITHER: the colour "number" index (typically 1 to 15) for the "normal" (for some values of normal) ANSI Set Graphics Rendition code {starts with ESC and ']' and ends with 'm' OR: what we decode those colours to be. If it is the latter it will make supporting 256-colour mode MUDs interesting as there are one or two duplicates in the range of 0-255 for the colour indexes, and there is nothing stopping the user setting two colours to be the same for the current 16-colour support...</aside>
Re: Color triggers
I see, it was a misunderstanding due to the terminology in mudlet then. In mudlet, a color trigger is a trigger that reacts on the ansi-color of the text the mud sends to you.tincan wrote:Thank you all for the advice, but it was just a little check box.
I'd noticed the "type" and kept choosing color trigger, which effectively erased my pattern. I only needed to check the "highlight" box.
Re: Color triggers
Hmm, I keep to a pretty basic mud; no triggers/stacks in most cases, and not many colors unless you manually define them (and many in-game aren't definable, which is why I'm here). I didn't even know that this would be a possibility, but that's definitely good info. Thanks!
Edit: On this topic still, how would I enable the color to apply to the entire line that the pattern is found in?
Edit: On this topic still, how would I enable the color to apply to the entire line that the pattern is found in?
I was sane once. I got better.
Re: Color triggers
The two easiest ways to do this that I can think of are:tincan wrote:Edit: On this topic still, how would I enable the color to apply to the entire line that the pattern is found in?
1) Extend the pattern to include the whole line and use the highlight tickbox.
As a perl regex pattern:
Code: Select all
.*stands up.*
2) Using lua. Works with most trigger types.
Last edited by chrio on Sat Sep 17, 2016 9:48 am, edited 1 time in total.