imagecount = 1
clock_current = {Season = "%4", day = tonumber("%3"), order = clock_seasons["%4"][4]}
local sunrise, sunset = clock_seasons[clock_current.Season][2], clock_seasons[clock_current.Season][3]
if "%1" == "Noon" then
winimg = "im12"
imgcount = 12
bgcolour = bgday
elseif "%1" == "Midnight" then
winimg = "im12"
imgcount = 24
bgcolour = bgnight
else
winimg = "im%1"
if "%2" == "a" then
imgcount = tonumber("%1")
else
imgcount = tonumber("%1") + 12
end
if imgcount >= sunrise and imgcount < sunset then
bgcolour = bgday
elseif imgcount >= sunset or imgcount < sunrise then
bgcolour = bgnight
end
end
update_image(winimg)
tprint(clock_current)
tprint(clock_seasons[clock_current.Season])