Good morning,
I'm from zMud and I try to translate some trigger from that to here, but I don't know how.
#TRIGGER {¡Envuelves a %1 en tu Estallido de fuego!} {#substitute {%ansi(yellow)¡Envuelves a %ansi(bold,magenta)%1%ansi(yellow) en tu Estallido de fuego! %ansi(white).}}
¡Envuelves a Culebra, dos Ciervos de la Llanura y Ardilla en tu Plaga de desdicha!
I want change color to the line, but I want the enemies will be have another color too. There are two possibilities, the spell only affect a one monster or maybe some monsters.
Can someone tell me how it works on mudlet?
Anocher question, can someone explain each option from triggers will be use for: like substring, perl regex, begin of the substring, exact match, Lua function, line spaccer, color trigger.
Thank you
How to work triggers
Re: How to work triggers
Sorry, isn't the answer I hope, I'm only waiting for an example to adapt my triggers, it is too complicated?
Well I adapt moreless and have this trigger:
Pattern: Curas algunas de tus heridas más (\w+).
trigger:
deleteLine()
cecho("<magenta> Curas algunas de tus heridas más <snow>" ..matches[2].."<white>.")
Result:
Pronuncias el cántico: 'magius elis curis' Curas algunas de tus heridas más ligeras.
The phrase will be one row down, can someone how can I do it?
Thank you
Well I adapt moreless and have this trigger:
Pattern: Curas algunas de tus heridas más (\w+).
trigger:
deleteLine()
cecho("<magenta> Curas algunas de tus heridas más <snow>" ..matches[2].."<white>.")
Result:
Pronuncias el cántico: 'magius elis curis' Curas algunas de tus heridas más ligeras.
The phrase will be one row down, can someone how can I do it?
Thank you
Re: How to work triggers
Do no something like this instead.newbie wrote:Sorry, isn't the answer I hope, I'm only waiting for an example to adapt my triggers, it is too complicated?
Well I adapt moreless and have this trigger:
Pattern: Curas algunas de tus heridas más (\w+).
trigger:
deleteLine()
cecho("<magenta> Curas algunas de tus heridas más <snow>" ..matches[2].."<white>.")
Result:
Pronuncias el cántico: 'magius elis curis' Curas algunas de tus heridas más ligeras.
The phrase will be one row down, can someone how can I do it?
Thank you
Re: How to work triggers
Thank you for the answer, that works perfect.
Now I have one new doubt, I have this trigger:
pattern:
(.*) herid? de gravedad.
trigger:
selectString(line,1)
replace("")
cecho(matches[2].."<purple> herido de gravedad<white>.")
The ? on the pattern is because it could be a letter a or o and it deppend from the sex of the npc, on zMud I have to put a ? but what I have to put on Mudlet?
Thank you
Now I have one new doubt, I have this trigger:
pattern:
(.*) herid? de gravedad.
trigger:
selectString(line,1)
replace("")
cecho(matches[2].."<purple> herido de gravedad<white>.")
The ? on the pattern is because it could be a letter a or o and it deppend from the sex of the npc, on zMud I have to put a ? but what I have to put on Mudlet?
Thank you
Re: How to work triggers
newbie,
I suggest reading up on pattern matching for regex. Here is a link to a cheat sheet.
www.addedbytes.com/cheat-sheets/regular ... eat-sheet/.
But to answer your question do:
(.*) herid(a|o) de gravedad.
I suggest reading up on pattern matching for regex. Here is a link to a cheat sheet.
www.addedbytes.com/cheat-sheets/regular ... eat-sheet/.
But to answer your question do:
(.*) herid(a|o) de gravedad.
Re: How to work triggers
Thank you to both, the answer is good.
Well I have a new question.
If I have this trigger:
pattern:
Tu (.*) se rompe en mil pedazos inservibles.
trigger:
selectString(line,1)
replace("")
cecho("<snow>Tu <grey>" ..matches[2].."<snow> se rompe en mil pedazos inservibles<white>.")
echo (" ¡Ohhhh!")
That I want are that some names on the mud have their own colors and I want preserve thats, this only an example, that I want is how can I put ..matches[2].. to get his own color If I put before a color because I have some words before that I want to change the color but not the word I capture from the mud.
Thank you
Well I have a new question.
If I have this trigger:
pattern:
Tu (.*) se rompe en mil pedazos inservibles.
trigger:
selectString(line,1)
replace("")
cecho("<snow>Tu <grey>" ..matches[2].."<snow> se rompe en mil pedazos inservibles<white>.")
echo (" ¡Ohhhh!")
That I want are that some names on the mud have their own colors and I want preserve thats, this only an example, that I want is how can I put ..matches[2].. to get his own color If I put before a color because I have some words before that I want to change the color but not the word I capture from the mud.
Thank you