Inactive Scripts Still Running

Post Reply
Jor'Mox
Posts: 1146
Joined: Wed Apr 03, 2013 2:19 am

Inactive Scripts Still Running

Post by Jor'Mox »

I have recently started transitioning my scripts to work with the event system in Mudlet in a more comprehensive manner, but I have run into a problem. When I disable a script, its event handler is still getting called when the event occurs, and everything seems to work as if the script were active. I also can't use the isActive function to determine if the script is active and control its behavior in that way. Any suggestions on how I can ensure that functions in disabled scripts don't fire?

Thanks.

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Inactive Scripts Still Running

Post by Vadi »

How are you disabling it? A disabled scripts event handler won't fire, but if you're calling the function directly, it will work.

Jor'Mox
Posts: 1146
Joined: Wed Apr 03, 2013 2:19 am

Re: Inactive Scripts Still Running

Post by Jor'Mox »

I am disabling it by in checking the check box next to it. But I think I see the issue. I'm registering anonymous event handlers to avoid problems if someone changes the script names, but those are then handled independently from the script itself, and so are still getting called.

So, there is no way to check to see if a script is active or not? If not, I guess I'll design a work around instead.

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Inactive Scripts Still Running

Post by Vadi »

There isn't at the moment. isActive() just works for timer, trigger and alias.

Post Reply