Looking for a way to destroy all timers currently running, even if you do not know the identifier. Something like self.clearButtons() but for timers.. does this exist at all?
Looking for a way to destroy all timers currently running, even if you do not know the identifier. Something like self.clearButtons() but for timers.. does this exist at all?
I have not played too much with timers but if they have an attribute like Description or Tag (like normal TS objects do) then you can set the description or tag when you create the timer and then do a GetAllObjects and check the description or tag to see if the object is a timer or not. Something like:
Code:for i,obj in pairs(getAllObjects()) if obj.getDescription()="Timer" then obj.Destruct() end end
that is the question though.... is there a way to "find them" or to clear them without knowing the tags.
Set the tags when you create them so that later you can find them.
If you already have a bunch of them in a workshop and you want to identify them, that might be harder. You can try the getJSON() to see if that includes properties which are specific to timers as a way of trying to identify them.
Thanks, but what I am just asking is, if there is a way to dynamically GET the existing timer names. In the same way you can go self.getButtons() or obj.getCustomObject() .. etc etc
Not as far as I know...This is why I suggested the getAllObject() with either Tag, Description or JSON to determine which of those objects are timers.