|
BartzS Beginner
Joined: 30 Aug 2004 Posts: 11
|
Posted: Wed Sep 01, 2004 5:10 am
Variables within Triggers |
Sorry to post another topic on this but when I went to reply it kept sending be back to the main menu for some reason .
Anyways, what I wanted to know was how to make one trigger work for several different strings that were similar.
Take these for example:
You find a white zircon.
You find a blue zircon.
You find a yellow zircon.
x 100 or whatever
How do I make a variable that would make it so I don't have to set up 100 different triggers for all of these similar strings?
In another scripting language I used it was simple because it had text extraction so I'd make the program pick up a zircon and put it in my container whenever it was triggered by this: You find a [color] zircon. This made it possible to use one trigger that would work for any color zircon. Does Zmud have text extraction?
Hope this was clear enough.
Thanks |
|
|
|
Falan Wanderer
Joined: 17 Aug 2004 Posts: 98 Location: OK, USA
|
Posted: Wed Sep 01, 2004 6:39 am |
Paste into the command line and press <Enter>
#TR {You find a %w zircon.} {put zircon in container}
%w is a wildcard that matches any number of alpha characters (a word). That'll match any one word description for your zircons. Replace the Command section with your MUD's proper command.
The Help files in the Library have good info on the subjects of Pattern Matching and Wildcards. |
|
_________________ zMUD 7.05a |
|
|
|
mr_kent Enchanter
Joined: 10 Oct 2000 Posts: 698
|
Posted: Wed Sep 01, 2004 1:06 pm |
If you want to reference the color to use in the command, then put parenthesis around the wildcard char.
#TR {^You find a (%w) zircon.$} {put %1 zircon in container}
In this case, %1 is a temporary variable containing the string which is the color. |
|
|
|
|
|