mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2003
Posts: 101
C
colt45 Offline OP
Vogon poet
OP Offline
Vogon poet
C
Joined: Nov 2003
Posts: 101
I've tried but no luck but what I've done was a lazy way to do but I'm hoping for a better solution that can run the timer infinitely on the time I set?

I have here which is silly and long ....

Code:
/timer1 00:00 0 3600 /runscript
/timer2 03:00 0 3600 /runscript
/timer3 06:00 0 3600 /runscript
/timer4 09:00 0 3600 /runscript
etc...


This is like running multiple timers and runs the script several times at once?

So I've tried another way which is ....
Code:
/timerRUNSCRIPT 0 3600 /runscript


That gives me problem because when I joined on the network say 12:20 .. it runs every hour on the 20 past frown

Any suggestion?
Thanks

Colt
(Excuse my poor english)

Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Run a timer that is checking the time every second :
Code:
//.timer 0 1 $!iif($right($time,5) == 00:00,.timerrunscript 0 3600 runscript)


Edit : a better way so you can stop the first timer :
Code:
alias check_rs .timerrunscript 0 1 $!iif($right($time,5) == 00:00,run_rs)
alias run_rs .timerrunscript off | .timerrunscript 0 3600 runscript
Type /check_rs to run the first timer

Last edited by Wims; 19/09/09 07:55 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Nov 2003
Posts: 101
C
colt45 Offline OP
Vogon poet
OP Offline
Vogon poet
C
Joined: Nov 2003
Posts: 101
Ok, I will give this a try .. call me stupid but does that means it's running every hour on the **:26 .. i.e. I started the timer just now at 21:26pm which would run the script at 22:26, 23:26, 00:26 and so on?

Or would that trigger the timer automatically be on the **:00 on the clock?

I'm running the script now to test .. hopefully if you can answer or re-solve the problem.

Thanks
Colt

Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Quote:
I started the timer just now at 21:26pm which would run the script at 22:26, 23:26, 00:26 and so on?
If you started the timer at 21:26, it will start to run the second timer at 22:00, which is running every hours, note that at 22:00, the command associed with this second timer won't be executed, you have to execute it separatly when you run this second timer

Last edited by Wims; 19/09/09 08:48 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jul 2008
Posts: 236
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Jul 2008
Posts: 236
Code:
alias get_next_hour {
  var %c = $ctime
  var %sec = $calc($asctime(%c,n) * 60 + $asctime(%c,s))
  return $calc(%c + (3600 - %sec))
}

alias test_next_hour {
  echo -a The next hour will be: $asctime($get_next_hour,hh:nn:ss)
}


and thus...
Code:
/timer $asctime($get_next_hour,hh:nn) 0 3600 runscript

Last edited by s00p; 22/09/09 05:04 PM.

Link Copied to Clipboard