|
|
Joined: Jul 2006
Posts: 4,149
Hoopy frood
|
OP
Hoopy frood
Joined: Jul 2006
Posts: 4,149 |
Imagine this 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
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Oct 2003
Posts: 3,918
Hoopy frood
|
Hoopy frood
Joined: Oct 2003
Posts: 3,918 |
- argv[0] on EFnet #mIRC - "Life is a pointer to an integer without a cast"
|
|
|
|
Joined: Dec 2002
Posts: 5,420
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 5,420 |
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.
|
|
|
|
Joined: Jul 2006
Posts: 4,149
Hoopy frood
|
OP
Hoopy frood
Joined: Jul 2006
Posts: 4,149 |
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
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Dec 2002
Posts: 2,031
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,031 |
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.
|
|
|
|
Joined: Jul 2006
Posts: 4,149
Hoopy frood
|
OP
Hoopy frood
Joined: Jul 2006
Posts: 4,149 |
What you said make sens, and now i agree but : 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
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
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.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
|
|