|
danextpope Newbie
Joined: 11 Apr 2007 Posts: 9
|
Posted: 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...
|
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: 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! |
|
|
|
chamenas Wizard
Joined: 26 Mar 2008 Posts: 1547
|
Posted: 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.
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: 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 |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: 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.
|
|
|
|
|
|