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
Jaiven
Wanderer


Joined: 03 Oct 2007
Posts: 66

PostPosted: 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
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: 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).
Reply with quote
Jaiven
Wanderer


Joined: 03 Oct 2007
Posts: 66

PostPosted: 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
Reply with quote
Jaiven
Wanderer


Joined: 03 Oct 2007
Posts: 66

PostPosted: Sat Jun 23, 2012 7:11 pm   
 
it just does open then goes north
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: 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.
Reply with quote
Jaiven
Wanderer


Joined: 03 Oct 2007
Posts: 66

PostPosted: Sat Jun 23, 2012 9:43 pm   
 
Thank you, you guys have made my conversion to cmud so much easier. I appreciate it
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