Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
JWhitney
Wanderer


Joined: 20 Oct 2006
Posts: 51

PostPosted: Fri Nov 25, 2011 12:20 am   

Coloring #SAY Messages
 
Is there a way to color #SAY and other system (or trigger) created messages with the non-ANSI default 16 colors? I've been using %ansi(0-15) to color them forever, but just found the huge list of colors that Zugg added and would like to utilize them.

Ex - normally I would do something like this:

Code:
#TRIGGER ((%*) tells you) {#SAY %ansi(12)%1 told you}


I'm really hoping I can do something like this instead:

Code:
#TRIGGER ((%*) tells you) {#SAY %ansi(limegreen)%1 told you}


The newer colors all appear to be referenced by their name rather than a color code, but when I tried converting them using the %color command, the result was an 8 or 9 digit number that when entered in via %ansi came up with a different result entirely (blinking underlined italized green-on-black, for example).

Thank you for your time.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Fri Nov 25, 2011 1:08 am   
 
Use MXP:

#SAY {<color limegreen>%1 told you</color>}

You could also go into preferences and on the style tab, change the color of info messages
_________________
Discord: Shalimarwildcat
Reply with quote
JWhitney
Wanderer


Joined: 20 Oct 2006
Posts: 51

PostPosted: Fri Nov 25, 2011 1:47 am   
 
Wow, thank you for the quick reply! Unfortunately, MXP would actually create a new problem for me - I simplified the example I posted above to make my purpose clearer, but in so doing I neglected to provide all relevant information. I use a set of variables to store the color number/name, and then call that variable for all similar messages, rather than assigning the number to each message. My pkg file is 210M+, and I have an unimaginably large number of triggers/aliases etc.

To more correctly reflect the above example, it would look like:

Code:
#TRIGGER ((%*) tells you) {#SAY %ansi(@tell_color)%1 told you}


and

Code:
#VAR tell_color {12}


There would also be another 10 or 20 triggers using that same @tell_color variable. The benefit of this is that it allows me to change colors for an entire set of messages, rather than having to adjust them all one-by-one.

From what I have tried in the past, MXP isn't able to expand a variable inside the tag, is this still correct?

Again, thank you for your time.
Reply with quote
hadar
Apprentice


Joined: 30 Aug 2009
Posts: 198
Location: my apt, in california

PostPosted: Fri Nov 25, 2011 3:16 am   
 
make it into a function like this

Code:

<func name="lightgreen" type="String" id="61">
  <value>%-1</value>
</func>


tjat way you can do #TRIGGER ((%*) tells you) {#SAY @lightgreen(%1 told you)}
_________________
if you build it they will come, assuming that they have not already come to build it
Aardwolf Bootcamp
My youtube channel
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Fri Nov 25, 2011 4:26 am   
 
you could store all that data in a dbVariable
and then use a local variable to get around that

$color=@{tell_color.%1}
#SAY {<color $color>%1 told you</color>}
_________________
Discord: Shalimarwildcat
Reply with quote
JWhitney
Wanderer


Joined: 20 Oct 2006
Posts: 51

PostPosted: Fri Nov 25, 2011 5:10 am   
 
With a minor adjustment, the function option works perfectly - you sir, are a genius. Thank you for assisting me!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net