|
Fergal1982 Wanderer
Joined: 08 Aug 2005 Posts: 70
|
Posted: 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 |
|
|
|
Insomniac Wanderer
Joined: 25 Mar 2004 Posts: 78 Location: United Kingdom
|
Posted: 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. |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: 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! |
|
|
|
|
|