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
radboi22
Novice


Joined: 19 Jan 2008
Posts: 30

PostPosted: Thu Mar 19, 2009 11:48 pm   

Quick Question with Wild Cards
 
You see exits leading north, east (open door), southeast, south, and west (open
door).

Exit line from Achaea.. Basically I want to parse all these directions to variables, I have the triggers to pick up North, East, Southeast, south, east, etc.
but when im in a room with only exit being southeast, It parses SOUTH, and EAST, How can I get the triggers to parse STRICTLY only a SINGLE WORD DEFINED.
I don't want it to parse North and West, when it's northwest, I only want northwest.
THANK YOU [:o]
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Fri Mar 20, 2009 7:54 pm   
 
Switch you trigger to RegEx and use word boundaries

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <trigger priority="510" regex="true" copy="yes">
    <pattern>\bnorth\b</pattern>
  </trigger>
</cmud>
_________________
Asati di tempari!
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Fri Mar 20, 2009 8:15 pm   
 
I know a little regex but all that looks confusing, does ZMud do boundaries?

To me Achaean exits were best gotten by a wildcard, as like in shallam cath you have a multiline room full of doors, after I replaced the spaces with |, also ( and ] with q and j so they did not confuse the functions I was using, and processed them into directions and work orders, was just to squint around.

of course this was not really a great thing but it worked for a while

if these are individual triggers on each direction putting ^ at the beginning and ? at the end will solve that. You need to anyway for 4321 triggers it takes to fight in that mud (speed thing)

if all else fails, you could play MUME, to go southeast, it is south and east
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Mar 20, 2009 9:52 pm   
 
The %q wildcard does word boundaries. This wildcard is also useful for differentiating between things like "tree" and "treehouse". %y is a similar wildcard (released at the same time as %q was, at least), but I never really grasped what it was actually used for and I don't really think anyone bothers using it.

Also, Tech seems to need more coffee Very Happy (assuming the topic wasn't moved.)
_________________
EDIT: I didn't like my old signature
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Sat Mar 21, 2009 8:36 am   
 
Definitely more coffee... Laughing
_________________
Asati di tempari!
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