Results 1 to 6 of 6

Thread: Is there a way to destroy timers without knowing the identifiers?

  1. #1

    Is there a way to destroy timers without knowing the identifiers?

    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?

  2. #2
    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

  3. #3
    that is the question though.... is there a way to "find them" or to clear them without knowing the tags.

  4. #4
    Quote Originally Posted by Tragic View Post
    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.

  5. #5
    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

  6. #6
    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.

Similar Threads

  1. Help with SAVE and ONLOAD and DESTROY
    By Tragic in forum Scripting
    Replies: 1
    Last Post: 05-16-2018, 07:16 PM
  2. Destroy objects in a zone Error
    By AndyZ in forum Scripting
    Replies: 1
    Last Post: 02-12-2017, 07:23 PM
  3. Timers - Bad Assumptions
    By LordAshes in forum Scripting
    Replies: 4
    Last Post: 07-23-2016, 09:48 PM
  4. Replies: 0
    Last Post: 02-19-2016, 01:21 PM
  5. Suggestion: Sand timers
    By 5000people in forum General Discussion
    Replies: 5
    Last Post: 06-12-2014, 10:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •