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


Joined: 03 Sep 2004
Posts: 34

PostPosted: 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.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: 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}
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Casius
Novice


Joined: 03 Sep 2004
Posts: 34

PostPosted: 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?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: 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}
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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