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
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Wed Nov 16, 2005 5:25 am   

help with pattern
 
this is the pattern im trying to use
~(~A~)(*)

#if (%1 != @mob) {#var mob 1}
basically, i want the var mob to be set to 1 if %1 doesn't match @mob, but @mob can be 7 words with ()/, ect. so i tried to put "" around @mob, didnt work. i tried using =~ without any luck. origianlly i had %w in the pattern, but since that only matched the first word, something like -=-=\name would trip it up so i switched to a *.
Reply with quote
Slaem
Apprentice


Joined: 20 Sep 2005
Posts: 135

PostPosted: Wed Nov 16, 2005 7:39 am   
 
Have you tried quotes around the %1 ?

#IF ("%1" != @mob) {#VAR mob 1}


Syntax Colourizer
_________________
Show your love.
Support Zugg Software!
Donate to zugg@zuggsoft.com with PayPal Send Money.
Reply with quote
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Wed Nov 16, 2005 5:00 pm   
 
but then wouldn't it just check for "%1" instead of what was captured?
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Wed Nov 16, 2005 5:10 pm   
 
"%1" means that it will take 1 word or 1,000,000,000 words.
it's like a capture all in between thing
_________________
http://www.Aardwolf.com
Reply with quote
Slaem
Apprentice


Joined: 20 Sep 2005
Posts: 135

PostPosted: Thu Nov 17, 2005 6:20 am   
 
Yep. The quotes make sure mutliple info is grouped together into the %1 paramter. Otherwise, when you check the parameter it may only return the first item in the parameter instead of everything.
_________________
Show your love.
Support Zugg Software!
Donate to zugg@zuggsoft.com with PayPal Send Money.
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