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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
hole
Newbie


Joined: 31 Jan 2005
Posts: 5

PostPosted: Wed Feb 02, 2005 11:51 am   

#CW : coloring a @ (variable)
 
Suppose my HP-bar is

HP: 100/150

and the trigger to capture the variables is

HP: @hp/@maxhp


What i want to do is color the @hp variable a certain color (for example: red) when it's below a certain value

What i've come up with is this:
#if (@hp<50) {#cw @hp high,red}

Which works..but..it will (and i know its supposed to do that) substitute the current value of the @hp and color that..
For example.. when my hp bar looks like HP: 30/150, it wil color the value 30 in the hp bar red (= good), but it will also color every "30" in the screen red (=bad)

Is there a way to ONLY color the @hp var in the HP bar red when below a certain value?
Reply with quote
Pega
Magician


Joined: 08 Jan 2001
Posts: 341
Location: Singapore

PostPosted: Wed Feb 02, 2005 4:12 pm   Re: #CW : coloring a @ (variable)
 
hole wrote:
Is there a way to ONLY color the @hp var in the HP bar red when below a certain value?

Yes. Here is one way of doing it:

#TRIGGER {HP: &%n{hp}/&%d{maxhp}} {#if (%1<50) {#psub {%ansi( high, red)%1} %x1}} "" {case}

Used Pretty Print
Syntax Colourizer
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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