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
palio
Novice


Joined: 30 Jul 2003
Posts: 36

PostPosted: Mon Sep 01, 2003 8:48 am   

parsing
 
I am trying to make the following trigger
You learn from your mistakes, and your heal light skill improves. (84%)


If I use this trigger:
You learn from your mistakes, and your (*) skill improves. (*)

#CO 206
#BEEP
#var spellname %1
#var percentnumber %2


Spellname is filled with heal (light is not put in there)
percentnumber is filled with (84%

Can someone explain to me how to get the full spell name and the number without the ( in the percentnumber


A secont question is there is a tag sent by the mud for room names

<rname>The Temple</rname>

I would like to leave my mxp on but I want that to not do anything. Is there a way to stop <rname> from coloring the room name and just using the mud default. The reason for this is if a room has a colored name on the mud you cant see the colors.

Please feel free to email palio@blinksoft.com with answers/suggestions
Reply with quote
palio
Novice


Joined: 30 Jul 2003
Posts: 36

PostPosted: Mon Sep 01, 2003 11:42 am   
 
You learn from your mistakes, and your (*) skill improves.~((%d)~)

I have also tried this and it does not seem to work either
Reply with quote
user0101
Apprentice


Joined: 01 Aug 2003
Posts: 100
Location: USA

PostPosted: Mon Sep 01, 2003 2:32 pm   
 
#TRIGGER {^You learn from your mistakes, and your &spellname skill improves. ~((%d~%)~)} {#CO 206;#BEEP;#var percentnumber %2}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Sep 01, 2003 5:26 pm   
 
Pattern:
You learn from your mistakes, and your (*) skill improves. ~((%d~%)~)

Value:
#CO 206
#BEEP
#VAR spellname {%1}
#VAR percentnumber %2

Explanation:
Many non-alphanumeric characters have special meanings to zMUD. When you want zMUD to ignore the special meanings and treat them like ordinary characters, you have to tell zMUD. You do this with the ~ character. In addition, zMUD has many wildcards to choose from and they can be quite helpful in picking out the precise information you want from a pattern. For more information, see the helpfile topic on Patterns/Pattern Matching.

The #VARIABLE command interprets spaces as the division between one part of the command and the next. If you look up the helpfile on #VAR, you'll find that for your example,
#VAR spellname %1 = #VAR spellname heal light
the first part is the variable name (spellname), the second part is the variable's value (heal), and the third part is the variable's default value (light).

Of course, people often want to put more than one word in a variable so naturally there's a way to tell zMUD that the space doesn't mark the end of one part and the beginning of the next. That's by grouping the Value using {}.
#VAR spellname {%1} = #VAR spellname {heal light}
Now the second part is {heal light}, so the value will be "heal light". There is no longer a third part, however the old default value will remain.
Reply with quote
palio
Novice


Joined: 30 Jul 2003
Posts: 36

PostPosted: Mon Sep 01, 2003 9:24 pm   
 
This works wonderfully Lightbulb.
Thank you. I see what I was doing wrong. Never occured to me to put a ~ before the % sign in the trigger. I was thinking only about the ()

Thank you. I am still looking for a suggestion on the rname problem
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