|
radboi22 Novice
Joined: 19 Jan 2008 Posts: 30
|
Posted: 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] |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: 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! |
|
|
|
Leitia Adept
Joined: 04 May 2007 Posts: 292 Location: Boston
|
Posted: 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 |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 (assuming the topic wasn't moved.) |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Sat Mar 21, 2009 8:36 am |
Definitely more coffee...
|
|
_________________ Asati di tempari! |
|
|
|
|
|