Moon Phase

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Moon Phase

Post 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
Attachments
MoonPhase.zip
(54.3 KiB) Downloaded 149 times
moonphase.PNG
moonphase.PNG (7.82 KiB) Viewed 1206 times
Steve Horn
HouseBot Guru
Posts: 750
Joined: Wed Apr 02, 2003 8:10 pm
Location: Pelham AL

Re: Moon Phase

Post by Steve Horn »

Cute, Thanks! :D
Steve
Post Reply