Match a trigger, highlight the next line of text

Posted by Sleeve on Fri 19 Sep 2003 10:13 PM — 4 posts, 16,402 views.

#0
On the mud I play on, there is a small chance that a spellup spell that you cast could be a "lucky" cast that ends up with greater affects than normal ones. In that case, the output goes like this:

Your magic is blessed with the luck of Mota!
You grant yourself the favor of Mota.


What I would like to do is match on the "Your magic is blessed with the luck of Mota!", omit it from the output, and highlight the next line in yellow or another color (to easily indicate to me that it was a lucky cast). I can't really figure out if this is possible or not, so I thought maybe somebody here can help. Another thing is that the second line can be different messages, it is not always "You grant yourself the favor of Mota."
USA #1
Hmm.

<triggers>
  <trigger
   enabled="y"
   match="^Your magic is blessed with the luck .*"
   omit_from_output="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>enabletrigger &quot;Capture_spell&quot;,1</send>
  </trigger>
</triggers>

<triggers>
  <trigger
   custom_colour="17"
   enabled="n"
   match="^.*"
   regexp="y"
   send_to="12"
   sequence="100"
   name="Capture_spell"
   other_text_colour="gold"
   other_back_colour="black"
  >
  <send>enabletrigger &quot;Capture_spell&quot;,0</send>
  </trigger>
</triggers>

I am relatively certain that it will color the line before disabling itself, so this should works as long as the second line always appears immediately and regardless of what the line actually says.
#2
This is great! Thanks so much.. didn't realize it was a simple solution. :)
USA #3
No problem. I practically wrote the book on this sort of triggering and use it for channel traffic. Every time the mud adds a new channel I have access to I think, "Oh great, glad I coded all that mess already..." lol Though your problem was 'very' simple in comparison. ;)