Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
fawkespause
Newbie


Joined: 17 Oct 2009
Posts: 2

PostPosted: Sat Oct 17, 2009 3:09 am   

Patterns fooled by brackets?
 
I am using the following pattern, to report for variables: Health &HPVAR/&MHPVAR

The text I am looking for it to fetch is: Health [ 30/30 ]

The problem is, the variables are showing up as [ 30 and 30 ] respectively. Is there any way for me to have the pattern searcher ignore the brackets and only report the numbers? Thanks!

Edit: Placing a blue underlined space after MHPVAR makes it not report a bracket, but it can only be done with the last one, not the first one.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Oct 17, 2009 3:28 am   
 
The trigger should be:

#TRIGGER {Health ~[%s(%d)/(%d)%s~]} {whatever}

Keep in mind that this trigger assumes that there will be a space before and after the numbers even in triple digits. If not, you'll need to change it a little.

Charneus


Last edited by charneus on Sat Oct 17, 2009 3:53 am; edited 1 time in total
Reply with quote
fawkespause
Newbie


Joined: 17 Oct 2009
Posts: 2

PostPosted: Sat Oct 17, 2009 3:40 am   
 
With a little more hunting on the forums, and some more experimentation, I got this to work:

Health ~[ &HpVar/&MHpVar ~]

But thanks anyways!
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Oct 17, 2009 7:16 pm   
 
The syntax for direct assignment is as follows:

& -- denotes direct assignment
%? -- denotes the type of wildcard (%d, %x, %a, %w, %n, etc)
varname -- name of the variable

Like any other trigger pattern, the more specific you can make it the faster it can fail and therefore the faster CMud will execute (keeping in mind that CMud is fast enough that you probably won't notice the difference).
_________________
EDIT: I didn't like my old signature
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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