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
}