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


Joined: 30 May 2002
Posts: 17
Location: Denmark

PostPosted: Thu Apr 08, 2004 4:00 pm   

Trigger Help
 
Hi

I like to color the lines from the spells command depend on the level, name and how many % I have learned

This is a short output from the mud when I type spells:
Code:
Level:   1 Cause light            Mana:    5   Learned:   1% ( 12)
Level:   3 Cure light             Mana:    8   Learned:   1% ( 26)
Level:   4 Detect invis           Mana:   15   Learned:  79% ( 34)
           Detect magic           Mana:   10   Learned:  76% ( 35)
           Underwater breathing   Mana:   25   Learned:  78% (333)
Level:   5 Armor                  Mana:    5   Learned:  81% (  4)
           Soulburn               Mana:   10   Learned:   1% (363)
Level:   6 Cure blindness         Mana:   15   Learned:   1% ( 23)
Level:   7 Bless                  Mana:    5   Learned:  82% (  5)
Level:   8 Faerie fire            Mana:   20   Learned:   1% ( 43)
Level:   9 Continual light        Mana:    5   Learned:  75% ( 18)


I think I sould use something like this:
#TR {^spells$} {}
#CONDITION {Level:(%d)(%w)Mana:(%d)Learned:(%d)%~((%d)~)} {Within|Param=99}

But it wornt work
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Apr 08, 2004 5:31 pm   
 
Your pattern needs to match all the characters, including spaces or tabs (white space).
%d doesn't match white space. Neither does %w.
Since %w doesn't match spaces, it won't match more than one word. * is necessary for two-word spell names.
White space can be matched by the %s, %p, %q, *, ? wildcards or the &nn fixed width pattern. I've used %s, *, and &nn in the pattern below.

#COND {Level:%s(%d) (*) Mana:%s(%d)%sLearned:%s(%d) ~%~((&3)~)}

In order to actually change any colors, you'll also need a value for the #CONDITION. This will only affect the first line for each level.
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