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
Fergal1982
Wanderer


Joined: 08 Aug 2005
Posts: 70

PostPosted: Fri Oct 21, 2005 10:36 pm   

variable within a returned line
 
ok, im not sure how to phrase this, so it may get mixed up in the telling:

one of the skills in my MUD eventually returns a phrase such as:
Code:
You succeed in freeing a clump of bronze ore from the surrounding rock.

although the word bronze can be substituted for several different words. i need a trigger that can pick up on the bronze, copper, etc, and feed it into a 'get' command.

Ive managed to set the trigger to beep using
Code:
You succeed in freeing a clump of %w ore from the surrounding rock.

but i have no idea how to extract the variable in %w for use further on in the trigger.

any suggestions?

Thanks
Fergal
Reply with quote
Insomniac
Wanderer


Joined: 25 Mar 2004
Posts: 78
Location: United Kingdom

PostPosted: Fri Oct 21, 2005 11:30 pm   
 
Wrap the %w in parenthesis () to capture it.

#TRIGGER {^You succeed in freeing a clump of (%w) ore from the surrounding rock.} {#VAR OreIGot %1;get OreIGot}

%1 is the first thing in the trigger you capture, %2 the second, %3 the third etc etc.
_________________

No-one ever gets flamed for posting too much information. Conform to the PPP (Preferred Posting Protocol) and give as much information as possible, including MUD output where needed.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Fri Oct 21, 2005 11:49 pm   
 
The pattern matching and #Trigger help files are a good source of info

You succeed in freeing a clump of (%w) ore from the surrounding rock.

value:
#SAY Its clump of %1!
_________________
Zmud Support Library
Zmud Knowledge Base
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