Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

[Help] Trying to remove a callback function from an event.

Does anybody know how to remove a callback function from an event? I want to issue a command in the chat to deactivate said callback function. I have been looking through the documentation and cannot seem to find anything on it.
I don't know that there is a way to unregister the callback without restarting the sandbox. However, you can have the callback check some variable (probably in state) and possibly return immediately based on its value.
It's hard for me to understand your question. What callback function and event are you talking about ?
1423991465
The Aaron
Pro
API Scripter
Manveti is right. There isn't a documented way of unregistering for events you have subscribed for via the on() function. Checking a variable is the correct approach to avoiding future responses. You can see an example of this in my isGM script. Follow the active variable through the code at lines 10 (initializing it), 30 (checking if it needs to be on), 41 (checking it to avoid work) and 53 (turning it off when work is done).
Ok, thanks guys! I'll go that route! Appreciate the feedback!