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 7:15 pm   

Open Door Trigger (Cont)
 
I'm having a problem with my old open door trigger from zmud.

Mud String:
The closed gate block(s) your passage north.

Trigger:
^The closed (%w) block?s? your passage (%w).$

Value:
open %2.%1
%2

Result:
open
north

It needs to open north.door
then go north
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Jun 23, 2012 8:37 pm   
 
The reason it does this is because CMud is looking for the key field of door in the %2 variable. There's no such key there, so the obvious and proper result is a null value.

What you are doing is a practice called "implicit concatenation". To avoid situations like this, it's a good idea to surround the literal portions of your string with double quotes:

open %2"."%1

Additionally, you cannot start a line with a variable or function reference, except in the case of a=b style assignment. Use #SEND (if you want to see the command echo) or #SENDRAW (if you don't want to see the command echo) to send stuff to the mud.
_________________
EDIT: I didn't like my old signature
Reply with quote
Jaiven
Wanderer


Joined: 03 Oct 2007
Posts: 66

PostPosted: Sat Jun 23, 2012 9:10 pm   
 
Thank you! I appreciate all the additional info too!
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