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
kazu
Beginner


Joined: 16 Sep 2008
Posts: 17

PostPosted: Thu Sep 18, 2008 8:04 pm   

regex question
 
Ok, starting to feel like I live here as much as I pop in. Anyways, here's my problem. I'm trying to make my trigger highlight a variable different colors depending on the situation. Here's what I have.

\b@target\b

#IF (@rebounding = 0 AND @shield = 0) {#CW green,black}
#IF (@rebounding = 1 AND @shield = 0) {#CW red, black}
#IF (@rebounding = 0 AND @shield = 1) {#CW yellow, black}
#IF (@rebounding = 1 AND @shield = 1) {#CW blue, black}

Thanks for all the help, sorry to keep bugging you guys so much. Me and the others helping me are being driven crazy as to why this won't work. Line one does work, but the last 3 don't.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Sep 18, 2008 9:04 pm   
 
Try this
Code:
#CW %case(%eval(@rebounding+@shield+1),"green.black",%if(@shield,"yellow,black","red,black"),"blue,black")

_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
kazu
Beginner


Joined: 16 Sep 2008
Posts: 17

PostPosted: Fri Sep 19, 2008 12:11 am   didn't work
 
well, i tried it but it completely blacked out the name of the target

I stand corrected, it didn't work for the very first part that was supposed to be green. Otherwise, it works fine.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Sep 19, 2008 12:25 am   
 
Typo on my part. I have "green.black" when it should be "green,black".
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
kazu
Beginner


Joined: 16 Sep 2008
Posts: 17

PostPosted: Fri Sep 19, 2008 12:58 am   
 
Works perfectly, thanks!
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Fri Sep 19, 2008 1:53 am   
 
If you think you live here, look at Vij ;)

But he *is* a genius :P
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
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