Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Equipt Overlay Glasses & Clock Peripherals
- local interface = peripheral.wrap("back")
- --Canvas to draw objects on
- local canvas = interface.canvas()
- canvas.clear()
- --Group box and text objects together
- local iGroup = canvas.addGroup({0,50})
- local rect = iGroup.addRectangle(0,0,180,32, 0x00FF002F)
- local text = iGroup.addText({5,5}, "")
- local dbg = iGroup.addText({5,15}, "")
- local day
- local tracker = 0
- local flag = 0
- local daysLeft
- while true do
- day = interface.getDay()
- angle = math.floor(interface.getCelestialAngle() + 0.5)
- light = interface.getSkyLight()
- if day ~= tracker then
- tracker = day
- flag = 0
- --daysLeft = (36-day%36)
- --text.setText("Day: " .. day .. " | " .. daysLeft .. " Days to " .. tracker)
- end
- if (angle > 355 or angle < 5) then
- if light <= 8 then
- text.setText("Eclipse!")
- flag = 1
- end
- else
- text.setText("")
- end
- if (flag == 1 and angle > 95 and angle < 245) then
- text.setText("Get Ready for Holog")
- end
- dbg.setText("A: "..angle.." L: "..light.." F: "..flag.." T: "..tracker)
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement