mIRC Home    About    Download    Register    News    Help

Print Thread
#22914 07/05/03 08:03 AM
S
ScatMan
ScatMan
S
-c switch will make a difference in /timer only if it's 0 0 right?

#22915 07/05/03 08:06 AM
N
neophyte
neophyte
N
Quote:
If you specify the -c switch, this makes mIRC "catch up" a timer by executing it more than once during one interval if the real-time interval isn't matching your requested interval.



/help /timer

#22916 07/05/03 08:11 AM
S
ScatMan
ScatMan
S
u don't need to copy it from the helpfile i can do that myself,
i'm asking here becuz i don't understand from the helpfile

#22917 07/05/03 09:08 AM
N
neophyte
neophyte
N
It's very easy to understand.



Try thinking of it like this:

The timer starts, and it is out of sync with the real time clock that mIRC runs. therefore it doesn't run exactly on time.
By specifying the -c switch, mIRC forces the timer to play catch up, until it's running in sync with the real time clock.

Or in simpler terms, it's like trying to catch up with a runner in an event that has a 5 second lead, you run super fast until you've caught up.

I also don't see the point of making at timer run every 0 seconds. Set it to run every one second instead

/timerName 0 1 { do something }

Last edited by neophyte; 07/05/03 09:10 AM.
#22918 07/05/03 09:32 AM
S
ScatMan
ScatMan
S
what does mean 'catch up' ?

#22919 07/05/03 10:39 AM
N
neophyte
neophyte
N

#22920 07/05/03 05:31 PM
_
_D3m0n_
_D3m0n_
_
LMFAO @ pulling out dictionaries

#22921 08/05/03 04:29 AM
Joined: Jan 2003
Posts: 2,125
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,125
It means that if, for some reason, mirc didn't execute the command associated with a timer in time, it triggers it right after it's finished doing whatever it's doing and before the next scheluded repetition. At least that's the effect I understand (I use it in one of my scripts to animate a dialog). It's not easy to understand exactly what I mean unless you have the proper conditions; something like a milliseconds timer with a short interval calling an intensive (cpu-wise) command. In such cases, it seems that more cpu is given to mirc for that, although the "regularity" of the repetitions is lost.

#22922 08/05/03 06:29 AM
S
ScatMan
ScatMan
S
yeah but once i did a command with /timer -c 0 0
and it work so fast that my computer stuck

#22923 08/05/03 07:02 AM
N
neophyte
neophyte
N
thats because your telling the timer to run in what is essentially, an infinite loop.


thats why you need to specify a time greater than 0 for the command to actually be run.

#22924 08/05/03 08:51 AM
S
ScatMan
ScatMan
S
no, its NOT an infinite loop, its just a VERY FAST timer
i could stop it but it takes time becuz its very fast

#22925 08/05/03 11:43 AM
Joined: Dec 2002
Posts: 2,006
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,006
If you were to set a timer /timerTest 0 0 echo -a test with or without -m .. you would see that mIRC makes it this * Timer test 1ms delay echo -a test .. mIRC won't go lower than 1ms delay.

#22926 08/05/03 12:06 PM
S
ScatMan
ScatMan
S
i still don't get it, what does the -c switch exactly?

#22927 08/05/03 12:59 PM
Joined: Dec 2002
Posts: 2,006
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,006
I've never used it so I really don't know, but the 4th post in this thread (neophyte) seems to make the most sense to me.

#22928 08/05/03 03:59 PM
N
Nimue
Nimue
N
If you type this you will see the timer start its repetitions after the loop has finished
Code:
//timerctest -m 3 500 echo -s $!ticks | var %a = $ticks,%b = %a + 1000 | while %a < %b { var %a = $ticks }


Now this one (identical except for the "c"), again the timer fires after the loop, but the first couple of reps are fired immediately the loop has finished, so as to 'catch up'.
Code:
//timerctest -mc 3 500 echo -s $!ticks | var %a = $ticks,%b = %a + 1000 | while %a < %b { var %a = $ticks }


#22929 08/05/03 09:04 PM
S
ScatMan
ScatMan
S
uhh got it
but can u explain why when i doing /timer -c 0 0 it works very very fast ??

#22930 09/05/03 01:27 AM
N
Nobodi
Nobodi
N
From the help file /help /timer

Quote:

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


Link Copied to Clipboard