![](templates/Classic/images/spacer.gif) |
Jaiven Wanderer
Joined: 03 Oct 2007 Posts: 66
|
Posted: Sat Jun 23, 2012 2:55 pm
closed door trigger |
^The closed (%w) block?s? your passage (%w).$
open %2.%1
%2
I can't get it to work with cmud but it worked with zmud |
|
|
![](templates/Classic/images/spacer.gif) |
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Sat Jun 23, 2012 5:10 pm |
Your pattern looks a bit odd... I think you want
Code: |
^The closed (%w) block? your passage (%w).$ |
? is a wildcard for a single character. Your pattern would match block, then any character, then an s, then any character. This shouldn't have worked in zmud either... Assuming the single character after block can only be an s, you could also use {s|} instead of question mark (match s or nothing). |
|
|
![](templates/Classic/images/spacer.gif) |
Jaiven Wanderer
Joined: 03 Oct 2007 Posts: 66
|
Posted: Sat Jun 23, 2012 7:08 pm |
Ah, sorry I should have provided the actually txt string from the mud to help explain
The closed gate block(s) your passage north. the s is just a normal s.
anyone have any luck with this? I still can't get it to open north.gate |
|
|
![](templates/Classic/images/spacer.gif) |
Jaiven Wanderer
Joined: 03 Oct 2007 Posts: 66
|
Posted: Sat Jun 23, 2012 7:11 pm |
it just does open then goes north
|
|
|
![](templates/Classic/images/spacer.gif) |
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Sat Jun 23, 2012 8:25 pm |
Ahhh, ok then. The problem is that the function of the dot changed - it's used for accessing keys in a database variable now, so your code is looking for a "gate" key in "north", not finding it (since north isn't even a database variable), so %2.%1 becomes null and it just sends open. If you want a literal dot, you need to put quotes around it. You could just use %2"."%1 (implicit concatenation), but it's best to use explicit concatenation, like this:
Code: |
#TRIGGER {^The closed (%w) block~(s~) your passage (%w).$} {#SEND %concat( "open ", %2, ".", %1);#SEND %2} |
I also changed the question marks in the pattern to literal parentheses, if there can be other characters there you can change it back. |
|
|
![](templates/Classic/images/spacer.gif) |
Jaiven Wanderer
Joined: 03 Oct 2007 Posts: 66
|
Posted: Sat Jun 23, 2012 9:43 pm |
Thank you, you guys have made my conversion to cmud so much easier. I appreciate it
|
|
|
![](templates/Classic/images/spacer.gif) |
|
|