|
Casius Novice
Joined: 03 Sep 2004 Posts: 34
|
Posted: Sun Feb 18, 2007 7:40 pm
capturing data from mud |
I am trying to capture some data from the Zmud but im not sure how to do it. The Mud displays this
A wild ginger plant (wild ginger) 10 left.
A ginseng plant (ginseng) 10 left.
now i would like to capture the number 10 and put that into a variable but im not sure how to set that as a trigger. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sun Feb 18, 2007 8:12 pm |
You use the pattern matching (see the help topic of that name) symbols. %w is a word, * is anything (or nothing), %d is a number. So you'd get something like:
#trig {^A * ~(*(%w)~) (%d) left.} {#var %1 %2} |
|
|
|
Casius Novice
Joined: 03 Sep 2004 Posts: 34
|
Posted: Tue Feb 20, 2007 5:09 pm |
Great that makes more sense but i didnt give you the correct triggers, i could not edit it for some reason
A valerian plant (valerian)___________10 left
Without the underscore. there is a long space between the last word (valerian) to the number would the prevous script still work for that? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Feb 20, 2007 5:43 pm |
The forums eat more than space. %s in a trigger pattern represents any number of spaces - add that where the spaces would be:
#trig {^A * ~(*(%w)~)%s(%d) left.} {#var %1 %2} |
|
|
|
|
|