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


Joined: 02 Dec 2001
Posts: 80
Location: Canada

PostPosted: Sun Jan 25, 2004 11:20 am   

Capturing wildcards into variables
 
Im having trouble catching variables that are bigger than one word when using wildcards.

E.g.:
#tr {To get home, you need to go: &directions} {@directions}

The problem here is... the mud reports something like (North.) or (Climb wall.) so the trigger sends North. or Climb wall. to the mud... this ALMOST works... it would work without . on the end.

What I need to know, is there way to strip it?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Jan 25, 2004 11:44 am   
 
If you don't need to store this command into a variable, you can just use the * wildcard:
#TRIGGER {To get home, you need to go: (*).} {#EXEC {%1}}

If you want to capture it into a variable, then you can use {} to tell zMUD where the name of the variable ends:
#TRIGGER {To get home, you need to go: &{directions}.} {#EXEC {@directions}}
Reply with quote
Eyeless
Wanderer


Joined: 02 Dec 2001
Posts: 80
Location: Canada

PostPosted: Sun Jan 25, 2004 2:12 pm   
 
Sweet.

Works perfectly.
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