Setup a Task that triggers each midnight and calls for this sub in whatever script you have running.
Have fun
Code: Select all
'-------------------------------------------------------
'-Set Moon Phase @ midnight by Task --------------------
'-------------------------------------------------------
Sub Set_MoonPhase()
Dim MoonCycle
Dim NewMoon
Dim Days
Dim CycleDay
MoonCycle = 29.530589
NewMoon = "4-1-2011 00:00:00"
Days = DateDiff("d", NewMoon, Now)
While Days > MoonCycle
Days = Days - MoonCycle
Wend
CycleDay = Round(Days)
SetPropertyValue "Weather.Moon Phase", "C:\Program Files\HouseBot\Config\Themes\Autohome\MoonPhase\Day " & CycleDay & ".png"
End Sub