Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local controller = peripheral.find('arController')
- local detector = peripheral.find("environmentDetector")
- controller.drawItemIcon("minecraft:clock", 4, 4)
- while true do
- local timeseconds = math.floor((detector.getTime() % 24000) / 20)
- local endTime
- local endTimeNum = math.floor(60*((timeseconds / 60) % 1))
- if endTimeNum < 10 then
- endTime = "0" .. tostring(endTimeNum)
- else
- endTime = tostring(endTimeNum)
- end
- controller.clearElement("clock_text")
- controller.drawStringWithId("clock_text", tostring(math.floor(timeseconds / 60)) .. ":" .. endTime, 20, 8, 16777215)
- os.sleep(0.25)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement