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
Xiija
Newbie


Joined: 24 Apr 2018
Posts: 7

PostPosted: Tue Mar 24, 2020 11:33 pm   

coloring words sent to another window
 
I have a trigger to get my group's hp & stam

(%w)(*)Health: (%d)%.(*)Stamina: (%d)%.

i send it to the group window like so

@memb = %1
:group: @memb %3 %5

works good but all the text is yellow.

i'd like to change the text color based on hp / stam levels.

tried alot of stuff like this...

#IF ( %3<70) {#sub { %ansi(orange)%3} } {#IF ( %3<40) {#sub { %ansi(red)%3} } {} }
#gag
:group: @memb %3 %5

and
#IF ( %3<70) {#PCOL mxporange %x3} {#IF ( %3<40) {#PCOL mxpred %x3}{}}



not working, any ideas?

ty :)
Reply with quote
shalimar
GURU


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

PostPosted: Wed Mar 25, 2020 6:19 am   
 
first off, you don't use the @ symbol when defining a variable

memb=%1

#IF (%3<70) {memb=%concat(@memb, " <color orange>%3</color>")} {memb=%concat(@memb, " <color red>%3</color>")}

and then something similar for stamina
_________________
Discord: Shalimar#3679
Reply with quote
Xiija
Newbie


Joined: 24 Apr 2018
Posts: 7

PostPosted: Wed Mar 25, 2020 4:09 pm   
 
Tysm :)

it was very close, yours didn't recolor the group window text, but this did...

#IF (%3<70) {memb=%concat( @memb, " %ansi(high,green)- HP: %ansi(high,red)%3 ")} {memb=%concat( @memb, "%ansi(high,green) - HP: %ansi(high,green)%3 ")}
#IF (%5<70) {memb=%concat( @memb, " %ansi(high,green)- ST: %ansi(high,red)%5 ")} {memb=%concat( @memb, "%ansi(high,green) - ST: %ansi(high,green)%5 ")}
:group: @memb


Thnax again, was drivin me crazy :)
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