mIRC Homepage
Posted By: Wims timer delay - 09/10/07 06:40 PM
Imagine this code :

Code:
//timerGa 10 0 echo -a > $!timer(Ga).delay


$timer(Ga).delay return 1.

even if a timer can't really have 0 second of delay, I think the propriety should return what we put in the command
Posted By: argv0 Re: timer delay - 09/10/07 09:04 PM
True.
Posted By: Khaled Re: timer delay - 11/10/07 01:23 PM
mIRC normalizes values in many different commands/identifiers, so it wouldn't be practical for mIRC to store two sets of values for each one, ie. the first set being the values that you passed to it, the second set those actually being used. The only other option in this case would be to make /timer report an error if you try to use a zero timer delay, that could break existing scripts though.
Posted By: Wims Re: timer delay - 11/10/07 05:12 PM
I'm sure there are some good reasons to normalized values in mIRC but in this case, I think that the propriety have to return what we put, or at least the real values.
Report an error would be a very bad idea because it's not an error to put 0 in a delay
Posted By: RoCk Re: timer delay - 11/10/07 05:46 PM
I disagree, 0 is a valid interval only because mIRC fixes it for you by changing it to 1ms, so 1 is what $timer().delay should return. It's either that or as Khaled stated that the timer would report an error. I think it's fine just the way it is and if you want $timer().delay to return the interval that you specified, then use a value greater than 0.
Posted By: Wims Re: timer delay - 11/10/07 06:10 PM
What you said make sens, and now i agree but :

Originally Posted By: mIRC help file 6.2 about /timer

if you specify a delay of 0 seconds, the timer will trigger immediately after the calling script ends.


I assume it's the same in 6.3 and so, if 0 isn't a valid interval, the help file must not said that 0 can be specify, or at least that 0 will be taken as 1

Thanks for explanation
Posted By: Riamus2 Re: timer delay - 12/10/07 10:08 AM
An interval of 0 and 1 are not the same thing. As RoCk said, 0 is treated as 1 milisecond, not 1 second. It's a way to trigger something "immediately" while still having the benefit of a timer. There are situations where this is necessary to achieve a specific result.
© mIRC Discussion Forums