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


Joined: 22 Apr 2004
Posts: 4
Location: USA

PostPosted: Mon Aug 25, 2008 4:56 pm   

Trigger ? How to keep it from firing more than once in a given ammount of time.
 
I'm new to creating triggers, but I would like to make a trigger that fires on an event, but if the mud displays the text to fire the trigger more than once in 15 seconds I only want the trigger to fire once.

Example:

Tony looks at you.

(trigger fires) wave Tony. (you wave at tony)

Tony looks at you.

(trigger is on timer, and can't fire again).


That's what I want to accomplish.... in a nutshell.
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Mon Aug 25, 2008 5:55 pm   
 
Code:

#trigger {Tony looks at you.} {#t+ WaveAlarm}
#alarm "WaveAlarm" {*1} {wave Tony}
#trigger {You wave at Tony.} {#t- WaveAlarm}
_________________
The Proud new owner of CMud.

--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
--------------------------------
Reply with quote
Erasmus
Wanderer


Joined: 04 Aug 2004
Posts: 82
Location: Philadelphia

PostPosted: Mon Aug 25, 2008 7:11 pm   
 
Code:
#TRIGGER {Tony looks at you.} {wave Tony}
#COND {} {} {Wait|Param=15000}
_________________
Erasmus

Last edited by Erasmus on Mon Aug 25, 2008 8:18 pm; edited 1 time in total
Reply with quote
Pchild
Newbie


Joined: 22 Apr 2004
Posts: 4
Location: USA

PostPosted: Mon Aug 25, 2008 7:27 pm   
 
But how long will that keep it from going off?

Say i want it to work again in 15 seconds, but not before...

that looks like it would make it not work again for ever.
Reply with quote
Pchild
Newbie


Joined: 22 Apr 2004
Posts: 4
Location: USA

PostPosted: Mon Aug 25, 2008 7:28 pm   
 
Erasmus wrote:
Code:
#TRIGGER {Tony looks at you.} {wave Tony}
#COND {} {} {Wait|Param=15000}
[/code]


That sounds better, thanks Erasmus


What are the {} {} for, i don't understand why they are needed, or what they do. I'm trying to advance my knowledge of triggers so I can make more complex ones in the distant future.
Reply with quote
Erasmus
Wanderer


Joined: 04 Aug 2004
Posts: 82
Location: Philadelphia

PostPosted: Mon Aug 25, 2008 8:18 pm   
 
The {} {} are placeholders. If you check out the help file for triggers the syntax is something like:

#TRIGGER "optional_but_useful_trigger_name" {Pattern you want to match} {script you want to execute} {Trigger Options} "Class"

The first {} is a placeholder for the pattern match. Using a blank {} will either match the trigger immediately, or when the next line is received from the mud regardless of what is on the line (can't remember which). The second {} is a placeholder for the script that basically says "do nothing when the trigger fires".
_________________
Erasmus
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