mIRC Home    About    Download    Register    News    Help

Print Thread
timer delay #187642 09/10/07 06:40 PM
Joined: Jul 2006
Posts: 3,559
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,559
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
Re: timer delay [Re: Wims] #187657 09/10/07 09:04 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
True.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: timer delay [Re: argv0] #187728 11/10/07 01:23 PM
Joined: Dec 2002
Posts: 4,521
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,521
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.

Re: timer delay [Re: Khaled] #187738 11/10/07 05:12 PM
Joined: Jul 2006
Posts: 3,559
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,559
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
Re: timer delay [Re: Wims] #187741 11/10/07 05:46 PM
Joined: Dec 2002
Posts: 2,010
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,010
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.

Re: timer delay [Re: RoCk] #187746 11/10/07 06:10 PM
Joined: Jul 2006
Posts: 3,559
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,559
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
Re: timer delay [Re: Wims] #187777 12/10/07 10:08 AM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
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