Page 1 of 1

Moon Phase

Posted: Mon Feb 14, 2011 2:56 pm
by Richard Naninck
Small rip from another forum, but a nice addition to your SWRemote.

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

Re: Moon Phase

Posted: Sat Feb 19, 2011 9:25 am
by Steve Horn
Cute, Thanks! :D