Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Display the current Minecraft in-game time on the first attached monitor.
- local monitor = peripheral.find("monitor")
- if not monitor then
- error("No monitor attached")
- end
- monitor.setTextScale(1)
- while true do
- local width, height = monitor.getSize()
- local message = "Time: " .. textutils.formatTime(os.time(), true)
- monitor.clear()
- monitor.setCursorPos(
- math.max(1, math.floor((width - #message) / 2) + 1),
- math.max(1, math.floor(height / 2))
- )
- monitor.write(message)
- print("Current time: "..os.time())
- sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment