Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
danextpope
Newbie


Joined: 11 Apr 2007
Posts: 9

PostPosted: Thu Sep 30, 2010 8:11 pm   

One shot events?
 
Is there anyway to create event handlers that only fire once then delete themselves, such as triggers created with #TEMP? I'm playing DragonRealms and have CMUD set to fire an event whenever a round time ends, and can use that event as needed in scripts to run sequences of commands one after another when round times end. Unfortunately, the events hang around, which occasionally causes problems. I could rewrite stuff to use #TEMP and #FIRE, but that strikes me as lot less aesthetic than a one shot event would be...
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Thu Sep 30, 2010 8:17 pm   
 
You can always use #UNEVENT to remove them after they run. The idea behind event's is that they are repeatable things and are designed to be used more than once. I can't be sure without more information but it seems that you may be better served by an #ALARM or a #WAITFOR.

Another alternative is to simply disable the events by placing them in a specific folder.
_________________
Asati di tempari!
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Thu Sep 30, 2010 8:34 pm   
 
If you need the events to fire once and then be off until something else happens you might consider disabling them instead of deleting them.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Fri Oct 01, 2010 7:39 am   
 
#EVENT onRtOver {#IF (@stuffToDo) {#FORALL @stuffToDo {#EXEC {%i}}}}

Do something like that, have triggers define @stuffToDo for you.
If the variable is empty, nothing happens.
_________________
Discord: Shalimarwildcat
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Fri Oct 01, 2010 12:29 pm   
 
In short, if you give us more specific information on what you want to do, we can help you decide which option is best for you. Given the information you have given so far, the best option (IMHO) is disabling events.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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