mIRC Home    About    Download    Register    News    Help

Print Thread
/timer maximum interval #221949 01/06/10 07:17 PM
Joined: Feb 2006
Posts: 32
Daveoh Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Feb 2006
Posts: 32
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?

Re: /timer maximum interval [Re: Daveoh] #221950 01/06/10 07:21 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: /timer maximum interval [Re: argv0] #221953 01/06/10 08:08 PM
Joined: Feb 2006
Posts: 32
Daveoh Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Feb 2006
Posts: 32
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.

Re: /timer maximum interval [Re: Daveoh] #221955 01/06/10 08:27 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
Re: /timer maximum interval [Re: Daveoh] #221971 02/06/10 05:09 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
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!

Re: /timer maximum interval [Re: Riamus2] #221972 02/06/10 05:33 PM
Joined: Apr 2010
Posts: 30
M
m0viefreak Offline
Ameglian cow
Offline
Ameglian cow
M
Joined: Apr 2010
Posts: 30
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

Last edited by m0viefreak; 02/06/10 05:34 PM.
Re: /timer maximum interval [Re: m0viefreak] #221973 02/06/10 05:54 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
Re: /timer maximum interval [Re: Daveoh] #221997 03/06/10 09:57 AM
Joined: Dec 2002
Posts: 4,998
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,998
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.