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


Joined: 01 Apr 2004
Posts: 20
Location: Purdue University

PostPosted: Thu Sep 23, 2004 3:14 am   

Duplicate Prompt Triggers
 
I'm having trouble with my prompt triggers firing twice, and the only thing I can think of is that there are duplicates located somewhere in the settings.

#TR {&{hp}h, &{mn}m, &{ed}e, &{wp}w (%w)~-} {} "" {prompt}
or
#TR {%dh, %dm} {} "" {prompt}

show up a lot in my mass of triggers, but each one has a unique value so I wouldn't expect anything to happen more than once.

This trigger is what I'm having the most trouble with is:
#TR {&{hp}h, &{mn}m, &{ed}e, &{wp}w (%w)~-} {#IF (@hp<2700) {action}} "" {prompt}
it will send action to the MUD twice, even though that specific value for the trigger is only given once (to my knowledge).

I'm wondering if there is a way to search for multiple trigger values, I have tried exporting everything to a text file and searching through that but I haven't had any luck.
Reply with quote
Serentus
Apprentice


Joined: 28 Sep 2001
Posts: 103
Location: USA

PostPosted: Thu Sep 23, 2004 4:32 am   
 
Try this:
#TR {&{hp}h, &{mn}m, &{ed}e, &{wp}w (%w)~-} {#IF (@hp<2700) {action}} "" {nocr|prompt}

without the nocr (no carriage return) your trigger is firing once on the prompt and again when the cr is received at the end of the command you enter. This can also be changed under the "options" tab, uncheck the Newline option.
_________________
-Serentus-
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Sep 23, 2004 4:39 am   
 
Yes, that trigger will fire twice. It has Trigger on Newline enabled by default and you've added Trigger on Prompt by using 'prompt' in the options field. Thus, the trigger will fire when the pattern is received as a prompt and then fire again whenever the next newline is received. To prevent this, just add 'nocr' to the options field or disable the Trigger on Newline option in the settings editor.
#TR {&{hp}h, &{mn}m, &{ed}e, &{wp}w (%w)~-} {#IF (@hp<2700) {action}} "" {prompt|nocr}
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
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