Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Purpose: To remind the player that the Astral Sorcery Horologium constellation is coming.
- Uses CC:Tweaked and Plethora mods to track the in-game Eclipse
- Made with the Engimatica 2:Expert modpack for Minecraft 1.12.2
- Wiki says eclipse occurs every 36 days, but only after the first eclipse
- I found the first eclipse in my testing world occured at 34 days
- --]]
- --Requires the Overlay Glasses, Clock & Daylight Sensor
- --Peripherals to be installed in the Neural Connector
- local interface = peripheral.wrap("back")
- --Canvas to draw objects on
- local canvas = interface.canvas()
- canvas.clear()
- --Group box and text objects together, all will be drawn on the canvas
- local iGroup = canvas.addGroup({0,50})
- local rect = iGroup.addRectangle(0,0,180,25, 0x00FF002F)
- local text = iGroup.addText({5,5}, "")
- local dbg = iGroup.addText({5,15}, "")
- local day
- local nextDay = 0
- local eclipseFlag = 0
- while true do
- day = interface.getDay()
- angle = math.floor(interface.getCelestialAngle() + 0.5)
- light = interface.getSkyLight()
- --Initialize variables for a new day
- if day ~= nextDay then
- nextDay = day
- eclipseFlag = 0
- rect.setColour(0x00FF002F)
- end
- if eclipseFlag == 0 then
- --Sets eclipseFlag based on celestial angle and sky light
- if (angle > 355 or angle < 5) then
- if light <= 8 then
- text.setText("Status: Eclipse!")
- eclipseFlag = 1
- end
- else
- text.setText("Status: ")
- end
- end
- --If it's night, Horologium should be visible
- if (eclipseFlag == 1 and angle > 95 and angle < 245) then
- text.setText("Status: Horologium is in the sky!")
- rect.setColour(0xFF0000FF)
- end
- --Data for debugging
- dbg.setText("A: "..angle.." L: "..light.." E: "..eclipseFlag.." ND: "..nextDay)
- sleep(5)
- end
- --daysLeft = (36-day%36)
- --text.setText("Day: " .. day .. " | " .. daysLeft .. " Days to " .. tracker)
Add Comment
Please, Sign In to add comment