View Single Post
  #15 (permalink)  
Old 04-11-2011, 12:42 PM
elesbb's Avatar
elesbb
Super genious in training
Offline
Threadstarter
Location: PA
 
Join Date: Jun 2010
Posts: 1,198
Reputation: 1600
elesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on repelesbb is halfway to VIP status based on rep
Mentioned: 42 Post(s)
Tagged: 0 Thread(s)
Re: Certain script run at a certain time

Quote:
Originally Posted by quick99si
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)
can you possibly put comments as to what each line is doing ? i think i understand the whole timestamp and unix format .. i beilieve with the IF statement you are ensuring it to be at MIDNIGHT , considering TimeStamp get the amount of seconds FROM 01/01/1970 ...
Reply With Quote