|
Ghurmuzh Newbie
Joined: 10 Apr 2009 Posts: 8
|
Posted: Fri Apr 10, 2009 12:20 pm
How to delete events |
I have a few trigger/alias collections that I wanted to use an
OnExit/OnError event for to clean up after themselves when
the action was finished but in order to keep from cluttering
my namespace with tons of events I need to be able to
delete them from a script. I expected to find something like
#UNEVENT but cannot seem to find anything like it. Is there
such a command at all?
Thanks. |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri Apr 10, 2009 1:09 pm |
I thought there was an #unevent, but you're right, there doesn't seem to be.
Are you sure you want to be repeatedly creating and destroying these actions? Enabling and disabling, and even redefining, takes a lot less processing than creating and destroying. |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Fri Apr 10, 2009 3:22 pm |
I don't think events were ever designed to be removed.
Generally, if you're doing it the way you're doing it, put it all into an alias or in the main script itself, then have the trigger deleted. I agree with Rahab that you probably don't want to be creating and deleting the settings constantly, though.
Events are really good for when you have several triggers that all fire the same script. Instead of typing a 300 line script (or even copy/paste), you can just put it into an event and do #RAISEEVENT whatever each time it calls for that script. ;)
Charneus |
|
|
|
Ghurmuzh Newbie
Joined: 10 Apr 2009 Posts: 8
|
Posted: Fri Apr 10, 2009 4:13 pm |
Thanks for the replies. In reading the documentation (I'm new to Zmud/Cmud) it
appeared one of the benefits of events was to have aliases that could not be
activated from the command line. For scripts tightly focussed on handling
a certain activity (like cutting gems) I like to have those aliases and triggers
only defined during that activity. In such a system I am not constantly
deleting and creating, rather I create when I start and when I'm done
I will delete all the scripts. Some activities may last 10 minutes, others
for hours.
I am coming to CMUD from tinyfugue, so I'm sure the patterns
are quite different and it appears a better pattern to use in CMUD
is to disable scripts you don't want active rather than deleting them? |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Fri Apr 10, 2009 6:22 pm |
Sure is. All you need to do is set them into classes. For instance, create a class called GemCut, then enable the class when you're cutting gems, then when you are done, disable the class.
That's one of the things I love about these clients: you can easily disable what you are not using, and enable what you are using. I have several scripts that need to be enabled only during certain times. :)
I hope this helps, and don't be afraid to ask any questions! :)
Charneus |
|
|
|
|
|