Why not set a timer to go off on the next sunday, then every 7days @ midnight?

Code:
on *:start:{

  ;the $calc() figures out how many seconds left until the next sunday
  .timer:Midnight-Check -oi 1 $calc(604800 - $ctime % 604800) Midnight:Command
}

alias -l Midnight:Command {

;since this triggered on sunday 604800seconds from now is the next sunday's midnight
  .timer:Midnight-Check -oi 0 604800 Midnight:Command 


  ;do stuff here
}

Last edited by FroggieDaFrog; 03/06/11 05:13 AM.

I am SReject
My Stuff