|
palio Novice
Joined: 30 Jul 2003 Posts: 36
|
Posted: 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 |
|
|
|
palio Novice
Joined: 30 Jul 2003 Posts: 36
|
Posted: 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 |
|
|
|
user0101 Apprentice
Joined: 01 Aug 2003 Posts: 100 Location: USA
|
Posted: 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}
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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. |
|
|
|
palio Novice
Joined: 30 Jul 2003 Posts: 36
|
Posted: 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 |
|
|
|
|
|