mIRC Homepage

Timed action

Posted By: dmmrs

Timed action - 01/09/04 09:30 AM

Is it possible to have an action set off at a specific time?

for example: ON TIME 14.20 /remove quotes.txt | /msg $chan updating quotes list.. PLease do not use !quote command for 10 minutes

so that at a specified time, itll remove the file quotes.txt and also at that time, msg a specified chan with the msg too?

Posted By: dr_Eamer

Re: Timed action - 01/09/04 10:39 AM

From the mIRC 6.16 help file: (/help /timer)

/timer[N/name] [-ceomhipr] [color:red][time] <repetitions> <interval> <command>[/color]
Activates the specified timer to perform the specified command at a specified interval, and optionally at a specified time.

/timer9 14:30 1 1 /say It's now 2:30pm

This will wait until 2:30pm and will then announce the time once and stop.

I guess it solves your problem.
Posted By: dmmrs

Re: Timed action - 01/09/04 01:02 PM

Yeah I read that in the help file too.

Unfortunately though it doesn't solve my problem.

First of all, I have to physically type in the timer each time i start mIRC. Secondly, even if I do that, i can only run one command. Een if I put in a seperator, the /remove quotes.txt command runs at the specified time, granted. However, the second command in the list will run as soon as I start the timer.

I want the commands:

/remove quotes.txt
/msg # the quotes list is being updated, please wait.

To run at a specified time each and every day, for example 13:30

Then, 10 minutes later after that command runs,

/msg # the list has now been updated.

I don't really want to have to type /timer2 blah blah

Every time i restart mIRC.
Posted By: dr_Eamer

Re: Timed action - 01/09/04 01:22 PM

Use on *:START:{ timer blah blah }
so that mIRC automatically sets the timer for you whenever you open mIRC. (although I'd suggest doing that on CONNECT because your script contains a msg command that can only be performed when you are connected)

Then if you want the timer to execute multiple commands there are two solutions:
a)Using an alias for the commands, then have the timer call the alias:
timer 13:30 1 0 blah

alias blah {

b)Use the $() identifier around the pipe:
timer 13:30 1 0 blah $(|) command $(|) remove $(|) do_whatever

Edit: Minor grammatical error...
Posted By: dmmrs

Re: Timed action - 01/09/04 02:06 PM

ok that works fine now.

one more question?

timerupdate 14:30 1 0

i dont really understand the meaning of the 1 and the 0 . The help file was a bit vague about it.

It's on a connect command now, with the two timers at 1 0.

Does this now mean they will repeat at 14:30 each day from now on?
Posted By: dr_Eamer

Re: Timed action - 01/09/04 05:39 PM

Ok here goes:
The parameters next to the time are the same parameters you would put to any timer.
When setting a

timer 14:30 M N command

it will cause the command to be executed at 14:30, M times, with N seconds interval.
It is like standing over your computer and your clock and when the time goes 14:30 you launch a " timer M N command ".

So the timer I gave you will execute the commands one (1) time and with no (0) interval (immediately).

This is not the way to make the command execute every day at the same time!
" timer 14:30 0 1 command " would execute the command after 14:30 every second, forever!
You have to reset the timer again to accomplish what you want.

Edit: Of course I suppose you'd want the timer to trigger without having to reconnect... I mean if you reconnect during the day, the timer will be reset by the on CONNECT event.

Please consult this thread for more on this!

Feel free to ask for more!
Posted By: Iori

Re: Timed action - 02/09/04 07:52 AM

on *:connect:{
  • [color:green] ; If timer is not already activated, set it from the on connect event to run an alias
    if !$timer(dostuff) { .timerdostuff -i 14.20 dostuff }
alias -l dostuff {
  • .remove quotes.txt
    if $me ison #channel {
    msg $v2 updating quotes list.. PLease do not use !quote command for 10 minutes

    ; It may be an idea to have the !quote event in a #group and here you could /disable the group.

    ; Re-set the timer to perform the second command(s) when upload is complete
    ; this time using -o switch (offline) so a possible disconnect won't unset it.

    .timerdostuff -o 1 600 domore
alias -l domore {
  • if $me ison #channel {
    msg $v2 the list has now been updated.

    ; If you used the #group, here you would /enable it again.

    ; Now set the timer to repeat the cycle, no need for the o switch this time.
    .timerdostuff 14:20 1 0 dostuff
Posted By: Iori

Re: Timed action - 03/09/04 09:04 AM

Of course the command in the connect event should be
  • if !$timer(dostuff) { .timerdostuff -i 14.20 1 0 dostuff }
© 2019 mIRC Discussion Forums