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


Joined: 03 May 2005
Posts: 72

PostPosted: Mon Sep 17, 2007 8:24 pm   

pattern with [] in it
 
I am havint trouble creating a trigger that captures a variable with a number in it
example

mud output

Gold: 0 Encumbrance: unencumbered
You are carrying the following on your person:
A pair of leather bracers (worn).
A simple bow.
A leather archer's quiver [60 arrows].

my current trigger is #trigger {A leather archer's quiver [%d arrows].} {#var arrowsinquiver %1}

so that the arrowsinquiver variable would hold the number 60
for some reason i think the brackets are messing up the trigger
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Mon Sep 17, 2007 8:48 pm   
 
its

Code:


#trigger {A leather archer's quiver ~[(%d) arrows~].} {#var arrowsinquiver %1}





Prog
_________________
The Proud new owner of CMud.

--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
--------------------------------
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Tue Sep 18, 2007 7:12 pm   
 
As Prog pointed out, any time you have a character that's defined as a special character (Such as [], @, %, *, (), etc.) you must include the quote character (~) in front of it. This is to tell zMUD "Hey, this is the pattern I want to match, not a special character!" I forget, but I believe if you want to see a list of all special characters, type #SHOW %def on the command line.

Charneus
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