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
Gimli
Beginner


Joined: 16 Oct 2005
Posts: 22
Location: Canada

PostPosted: Sun Dec 12, 2010 8:07 pm   

Matching Whitespace or not
 
Having troubles matching in CMUD...


Hits : 45 ( 93)


Though it can also look like

Hits : 124 (455)

as well..

I tried

Hits ~: &%d{HP} ~( &%d{HPmax}~)
Which works if there is a space, but when I go to use %s like
Hits ~: &%d{HP} ~(%s?&%d{HPmax}~)

but it doesn't seem to work.. tried to make it so I that I dont have to worry about how many whitespaces there are in my trigger.

What am I doing wrong?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Dec 12, 2010 8:21 pm   
 
Use a range (and, yes, you will not be able to use the &varname syntax).

&%dHP ~(([%s%d])~)

In the code, use %trim() to get rid of any whitespace and assign the result to your variable: HPmax = %trim(%2).
_________________
EDIT: I didn't like my old signature
Reply with quote
Gimli
Beginner


Joined: 16 Oct 2005
Posts: 22
Location: Canada

PostPosted: Sun Dec 12, 2010 8:50 pm   
 
So how do I set that up with the Trigger itself?
Do I do it in the CMD line, or do I use the Script portion in the Trigger?

so

#TRIGGER &%dHP ~(([%s%d])~)
#VAR HPmax %trim(%2)

Sort of thing?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Dec 12, 2010 9:18 pm   
 
If the trigger is already created, it's probably easier to just use the Package Editor instead of the command line. Anything with wildcards goes in the pattern box, anything that uses commands or the %1...%99 variables goes in the code box.
_________________
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