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
vileplume
Novice


Joined: 26 Dec 2001
Posts: 43
Location: USA

PostPosted: Wed Apr 24, 2002 4:28 am   

Trigger using #SAid text as pattern.
 
I was wondering if it's possible to use the text displayed by the #SA command as a trigger pattern? If so, would there be any reason why this would be a bad idea?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Apr 24, 2002 6:51 am   
 
The quickest way to find out would be to try it. You can use #SHOW for this purpose, I'm not certain if #SAY will work or not.

LightBulb
Vague questions get vague answers
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Apr 24, 2002 12:18 pm   
 
The output from #SAY should not fire triggers. That's why there is a #SHOW command. However, I think that for some reason, #SAY will fire triggers, althought it shouldn't.

Kjata
Reply with quote
vileplume
Novice


Joined: 26 Dec 2001
Posts: 43
Location: USA

PostPosted: Thu Apr 25, 2002 12:15 am   
 
The reason why I ask is the last time (yesterday in fact) that I used Lightbulb's method of experimentation I ended up in a neverending loop that resulted in my consumption of every last drop of 4 of my potions. I had to CTRL ALT DEL out of zmud to get it to stop. Therefore, I have concluded that for my next attempt I should perhaps do a little more research about possible pitfalls!
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Apr 25, 2002 1:20 am   
 
The only reason using #SAY, #SHOW, or other self-generated messages to fire triggers is a bad idea is the tendency to create loops. Of course, this only happens when you put the #SAY/#SHOW as the action of a trigger.

#SHOW is useful for testing triggers without waiting for the MUD to produce the text or for offline testing. This is done by entering the #SHOW command from the command-line.

Since you have carefully avoided providing any hint of what you are attempting to do, that's the best I can tell you at this time.

LightBulb
Vague questions get vague answers
Reply with quote
vileplume
Novice


Joined: 26 Dec 2001
Posts: 43
Location: USA

PostPosted: Thu Apr 25, 2002 4:05 am   
 
It's not really that I am avoiding it. I just haven't condensed it down into a format suitable for communication to others. The looping thing didn't happen because of the #sa though, that was just another failed experiment in general I was using as my excuse for not just running the #sa thing up the flagpole. Really I have been doing quite a bit of that sort of thing, but the incident with the loop has me a little gun-shy.

I did try using the #show command instead. In reading the help file about #show, I noticed it offers this guideline for using it:

....%{crlf} should be used for newlines instead of just %{cr}.

What does this mean?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Apr 25, 2002 5:43 am   
 
It means that if you are going to use #SHOW to simulate a multi-line message, you should use %{crlf} between lines. I've never tried it before (never had a need for more than one line). A brief experiment shows that you need %{crlf} to get a new line with #SHOW, either will work with #SAY. Didn't test #ECHO.

And I can understand being careful after getting caught in a loop. I do my best to avoid looping structures in my own scripts.

LightBulb
Vague questions get vague answers
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