mIRC Home    About    Download    Register    News    Help

Topic Options
#187642 - 09/10/07 07:40 PM timer delay
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3468
Loc: France
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
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#187657 - 09/10/07 10:04 PM Re: timer delay [Re: Wims]
argv0 Offline
Planetary brain

Registered: 13/10/03
Posts: 3918
Loc: Montreal, QC, Canada
True.
_________________________
- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Top
#187728 - 11/10/07 02:23 PM Re: timer delay [Re: argv0]
Khaled Offline


Planetary brain

Registered: 04/12/02
Posts: 4346
Loc: London, UK
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.

Top
#187738 - 11/10/07 06:12 PM Re: timer delay [Re: Khaled]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3468
Loc: France
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
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#187741 - 11/10/07 06:46 PM Re: timer delay [Re: Wims]
RoCk Offline
Hoopy frood

Registered: 16/12/02
Posts: 2009
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.

Top
#187746 - 11/10/07 07:10 PM Re: timer delay [Re: RoCk]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3468
Loc: France
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
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#187777 - 12/10/07 11:08 AM Re: timer delay [Re: Wims]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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

Top