mIRC Homepage
Posted By: Daveoh /timer maximum interval - 01/06/10 07:17 PM
The maximum interval time of a timer appears to be 19327352 seconds (31wks 6days 16hrs 42mins 32secs). Is there any specific reason for this? Also, if you go above it, it instantly performs the associated command. Is this intentional?
Posted By: argv0 Re: /timer maximum interval - 01/06/10 07:21 PM
Yes and yes. You probably want to set a timer by shorter intervals if you're looking at 31+ week intervals. It performs the command instantly because that's how it works-- certainly better than not at all.

It should be noted that timers aren't meant for long durations, as they can slip. What you should be doing is setting a timer at a smaller duration with multiple intervals, as it will be more accurate.
Posted By: Daveoh Re: /timer maximum interval - 01/06/10 08:08 PM
Hmm some shorter values also run instantly, but yeah I agree that they shouldn't be used for such long durations. I wouldn't ever set one personally for more than a day, it was just a dynamic timer situation.
Posted By: Riamus2 Re: /timer maximum interval - 01/06/10 08:27 PM
Originally Posted By: Daveoh
Hmm some shorter values also run instantly


Do you mean that things are evaluated instantly? For example, you have something like:

/timer 1 600 echo -a $chan(0)

... if you join more channels before the 600s is up, it will still show the number of channels you were in when the timer was started. Is that what you mean by running instantly? If so, then that's normal. You can prevent the evaluation until the timer triggers if that's what you're trying to do.
Posted By: hixxy Re: /timer maximum interval - 02/06/10 05:09 PM
If you want to go past that limit you could always use the timer to set another timer, like this:

Code:
//timer 1 2 timer 1 2 echo -a 4 seconds!
Posted By: m0viefreak Re: /timer maximum interval - 02/06/10 05:33 PM
About the evaluation thing:

That's because $chan(0) is evaluated first.
You end up with:
timer 1 600 echo -a 3

What you probably want is this:
timer 1 500 echo -a $!chan(0)

Notice the "!". this results in $chan(0) being evaluated when the timer actually runs the command
Posted By: Riamus2 Re: /timer maximum interval - 02/06/10 05:54 PM
Yes, I know. I was asking if that was what the OP was meaning and mentioned that you can prevent that if that was what he was referring to.
Posted By: Khaled Re: /timer maximum interval - 03/06/10 09:57 AM
In computer science, all number values have a range limit and if you go beyond that, the number wraps around to zero. In this case, you are specifying a value that goes beyond the range of what mIRC can handle.

When /timer was first added, I should have placed a reasonable maximum, say one day or one week, on the timer interval. I could do this now, however it would cause all existing scripts that go beyond this value to trigger incorrectly.

The maximum /timer interval value is not easy to determine because the value is used in a number of computations, so the actual range will be less than the maximum range for a signed long.
© mIRC Discussion Forums