Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Tip regarding setTimer()

    General Discussion
    1
    1
    106
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      SpencerBeige last edited by

      Hi all, this may be an extremely obvious tip, but I just fiddled around with some code for about an hour before figuring this out, so if this helps even one person, I'll be glad I wrote this up.

      I was using two timers that called each other - A did something for some number of times, then eventually called B. B did something and then called A. The problem was that I didn't know how many times A needed to run, so I just set its count to a really big number and, whenever B called A, I reset the count variable using newTimer. For what ever reason, fuze4 really doesn't like this solution.

      Here's the takeaway: Never call multiple newTimer()'s on the same function. You can use -1 for the count parameter to ensure that it will run forever

      1 Reply Last reply Reply Quote 2
      • First post
        Last post