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
ulmus
Beginner


Joined: 10 Oct 2002
Posts: 11
Location: Poland

PostPosted: Mon Mar 29, 2004 10:01 am   

problem with (*) and %1
 
I have a trigger
#trigger {Exits: (*)} {#sub %ansi(bold,magenta)==>" "%1}

Why doesn't it work?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Mar 29, 2004 12:49 pm   
 
The syntax for the #SUB command is:
#SUBSTITUTE string [string]

Where the second string is optional. If it is not present, then what #SUB does is substitute the text matched by the last trigger with the first (and only one present) string.

However, if the second string is present, then #SUB creates a new trigger with the pattern set to the first string and the command set to #SUB followed by the second string.

Since in zMUD scripting a space separates command arguments, your #SUB was being evaluated as the latter form. It was creating triggers with pattern %ansi(bold,magenta)==>" and command #SUB "%1.

To prevent this, you must tell zMUD that what comes after the #SUB is all one argument. You do this by enclosing it in braces. Like this:
#SUB {%ansi(bold,magenta)==>" "%1}
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