mIRC Home    About    Download    Register    News    Help

Print Thread
#96378 01/09/04 09:30 AM
Joined: Jul 2004
Posts: 40
D
dmmrs Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jul 2004
Posts: 40
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?

Thanks.


i script, therefore i am smirk
theres logic in there somewhere...
#96379 01/09/04 10:39 AM
Joined: Aug 2004
Posts: 101
D
Vogon poet
Offline
Vogon poet
D
Joined: Aug 2004
Posts: 101
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.


Maybe I wake up one day to notice that all my life was just a dream!
#96380 01/09/04 01:02 PM
Joined: Jul 2004
Posts: 40
D
dmmrs Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jul 2004
Posts: 40
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.


i script, therefore i am smirk
theres logic in there somewhere...
#96381 01/09/04 01:22 PM
Joined: Aug 2004
Posts: 101
D
Vogon poet
Offline
Vogon poet
D
Joined: Aug 2004
Posts: 101
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 {
command1
command2
remove
do_whatever
}


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

Edit: Minor grammatical error...

Last edited by dr_Eamer; 01/09/04 01:37 PM.

Maybe I wake up one day to notice that all my life was just a dream!
#96382 01/09/04 02:06 PM
Joined: Jul 2004
Posts: 40
D
dmmrs Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jul 2004
Posts: 40
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?


i script, therefore i am smirk
theres logic in there somewhere...
#96383 01/09/04 05:39 PM
Joined: Aug 2004
Posts: 101
D
Vogon poet
Offline
Vogon poet
D
Joined: Aug 2004
Posts: 101
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!

Last edited by dr_Eamer; 01/09/04 05:43 PM.

Maybe I wake up one day to notice that all my life was just a dream!
#96384 02/09/04 07:52 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
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
}[/color]

#96385 03/09/04 09:04 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Of course the command in the connect event should be
  • if !$timer(dostuff) { .timerdostuff -i 14.20 1 0 dostuff }
blush


Link Copied to Clipboard