mIRC Home    About    Download    Register    News    Help

Print Thread
#187642 09/10/07 06:40 PM
Joined: Jul 2006
Posts: 4,145
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #187657 09/10/07 09:04 PM
Joined: Oct 2003
Posts: 3,918
A
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"
argv0 #187728 11/10/07 01:23 PM
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
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.

Khaled #187738 11/10/07 05:12 PM
Joined: Jul 2006
Posts: 4,145
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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
Wims #187741 11/10/07 05:46 PM
Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
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.

RoCk #187746 11/10/07 06:10 PM
Joined: Jul 2006
Posts: 4,145
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #187777 12/10/07 10:08 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
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

Link Copied to Clipboard