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
Morgul_Wraith
Newbie


Joined: 25 Dec 2001
Posts: 5
Location: Canada

PostPosted: Tue Dec 25, 2001 5:25 am   

A problem with two characters that get in my way..
 
I tried to write a trigger, as follows...

#trigger {Your powerlevel increased by [%w].} {@PL += %1}

The major problem however, is that zMUD won't read it correctly... it won't read the [] or look for the number in between it... can you tell me how to fix this?
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Tue Dec 25, 2001 7:31 am   
 
You should also place the quote character in front of the ] too. You must enclose the %d in parentheses to capture the data. Also, zMUD doesn't support +=. Use the #ADD command instead.

#trigger {Your powerlevel increased by ~[(%d)~].} {#ADD PL %1}



Troubadour
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue Dec 25, 2001 8:29 am   
 
You should familiarize yourself with the special characters that zmud uses. Those have to be quoted out as Troubador indicated.

Give a man a fish and he is fed for a day...
Teach a man to fish and he is fed for life...
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Dec 25, 2001 5:16 pm   
 
quote:

You should familiarize yourself with the special characters that zmud uses. Those have to be quoted out as Troubador indicated.

Give a man a fish and he is fed for a day...
Teach a man to fish and he is fed for life...



Technically, they only have to be quoted out when you are using them in their specialized roles. So long as you don't need to depend on variable pattern-matching (such as 'You get (*)'), you can simply turn on verbatim mode for the trigger.

Likewise, if you need to deal with such characters inside of a variable, you need only use %expand() and specify how much expansion you wish to have--with, I think, -3 indicating no expansion at all.

li'l shmoe of Dragon's Gate MUD
Reply with quote
Morgul_Wraith
Newbie


Joined: 25 Dec 2001
Posts: 5
Location: Canada

PostPosted: Wed Dec 26, 2001 9:51 am   
 
Just to note, but the solution you gave me didn't work... the pattern test works, but when I receive the actual text from the mud, nothing at all happens...

I go by many names under the skies. I am known to some as Phobos, to others as simply Fear. To some I am Death, to others I am the Reaper.
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