Changing Output Colors

Posted by ChronicHobo on Mon 13 Dec 2010 04:56 AM — 3 posts, 13,966 views.

#0
Okay first time posting no hazing please :) Been supporter since 1999 and I am now delving into changing the output of a MUD so I can have fun and change things up some.

I currently have a trigger set to remove the line and input a current:



<triggers>
  <trigger
   enabled="y"
   match="*A lightning bolt leaps from your hand and arcs to a*"
   omit_from_output="y"
   send_to="2"
   sequence="100"
  >
  <send>Your hands form a deadly arc as you launch a Kamehameha a%2</send>
  </trigger>
</triggers>

<triggers>
  <trigger
   enabled="y"
   match="Your lightning * a *!"
   omit_from_output="y"
   send_to="2"
   sequence="100"
  >
  <send>Your Kamehameha %1 a %2!</send>
  </trigger>
</triggers>




But I don't want to change any of the colors from the game.

The output shows:

A lightning bolt leaps from your hand and arcs to a rainbow warrior.
You fade into existence.
Your lightning *** DEVASTATES *** a rainbow warrior!
The bolt arcs to an alchemist!
You claim an alchemist.
Your lightning RAZES an alchemist!

Where "*** DEVASTATES ***" and "RAZES" are red while the rest of the text is off white.

When the trigger responds it does the text replacement right but all the text comes out blue.

Been messing around with it for a lil while and can't get the output to leave the %1 color alone or keep the text the same.

Any tips?
Australia Forum Administrator #1
To start with:

Template:faq=23
Please read the MUSHclient FAQ - point 23.


In more detail, it is probably simplest to use a script function (ie. script file) rather than "send to script" because then you get the style runs as the 4th argument to the trigger function.

Then using the general technique described there, you can display existing stuff (using ColourTell) in the style it originally was, and changing words here and there as required.

That FAQ actually uses a slightly different technique, using TriggerStyleRuns which basically has the same stuff - the style runs (that is, colours etc.) of each piece of text on the line.
#2
Appreciate it Nick man.

I'll be working more on this later tonight still delving into scripting and what not. Triggers I am at home with and can normally work around.

I'll post a follow - up with a working and what I did in case anyone runs into this as well :)