View Single Post
  #11 (permalink)  
Old 04-11-2011, 07:47 AM
quick99si's Avatar
quick99si
Halfway to VIP Status
Offline
Location: Chicago, IL
 
Join Date: Dec 2007
Posts: 631
Reputation: 1245
quick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on repquick99si is halfway to VIP status based on rep
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: Certain script run at a certain time

Here's what I put together, it's semi-tested:
Code:
varAutoRunTime="00:01"
 
varSelf = SystemPath("ScriptPath") \ SystemPath("ScriptName") & SystemPath("ScriptExt")
varMort = SystemPath("ScriptExe") \ "MortScript.exe"
 
varAutoRunTimeH = part(varAutoRunTime,":",1)
varAutoRunTimeM = part(varAutoRunTime,":",2)
 
If(varAutoRunTimeH < 0 OR varAutoRunTimeH > 23 OR varAutoRunTimeM < 0 OR varAutoRunTimeM > 60)
   varAutoRunTimeH="07"
   varAutoRunTimeH="00"
EndIf
 
varTomorrow = TimeStamp()+86400
varTomorrowMidnight = varTomorrow - (FormatTime("H",varTomorrow)*3600) - (FormatTime("i",varTomorrow)*60) - (FormatTime("s",varTomorrow))
varTomorrowSchedule = varTomorrowMidnight + (varAutoRunTimeH*3600) + (varAutoRunTimeM*60)
You can combine the last 3 lines into one i you'd like. I just posted it that way to make it more legible online.

And then for the notification queue:
Code:
RemoveNotifications(varMort,"""" & varSelf & """")
RunAt(varTomorrowSchedule,varMort,"""" & varSelf & """")

Last edited by quick99si; 04-11-2011 at 09:23 AM.
Reply With Quote