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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Sat Mar 07, 2009 10:10 pm   

[3.04] #cw/#if incorrectly coloring data based on order
 
#cw is coloring incorrectly if there is an #if statement in the trigger. There is an order dependence which either causes it to be colored when it shouldn't or not colored when it should.

Steps:

1) Import the code below into a blank session
2) Type 'go'

You'll see this:

Bellor Pharaus Sard
Pharaus Bellor Sard
Sard Bellor Pharaus
Pharaus Sard

Only Pharaus should be colored with a 'redbrick' background. All the others should be a regular black background. If 'Pharaus' is the start of the list then all get the 'redbrick' background. If Pharaus isn't the start of the list, then none of them do, which is incorrect as well.

Code:

<class name="test" id="36">
  <trigger priority="99952" case="true" regex="true" id="30">
    <pattern>\b(@cityless)\b</pattern>
    <value>#if (%ismember( %1, @cityenemies)) {#CW white,firebrick} {#CW white}</value>
  </trigger>
  <alias name="go" id="32">
    <value>#show "Bellor Pharaus Sard"
#show "Pharaus Bellor Sard"
#show "Sard Bellor Pharaus "
#show "Pharaus Sard"</value>
  </alias>
  <var name="cityenemies" type="StringList" id="34">Pharaus</var>
  <var name="Cityless" type="StringList" id="35">Pharaus|Bellor|Sard</var>
</class>
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Sun Mar 08, 2009 10:03 am   
 
#CW has been this way for a long time. I believe Zugg has some code that checks for further matches in the line when #CW is issued. This makes the #CW command color all matches in the line with that color, which is what newer users want.

There is a little checkbox in trigger options "Repeat within line" that changes the matching behavior and makes it work as want.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Sun Mar 08, 2009 4:03 pm   
 
Excellent, that worked perfectly. I'd seen that options, but never realized it was for this, thanks!
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Mon Mar 09, 2009 3:29 am   
 
Moved my further issues to a new topic.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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