Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitor = peripheral.find("monitor")
- if not monitor then
- print("Monitor not connected!")
- return
- end
- monitor.setBackgroundColor(colors.black)
- monitor.setTextScale(1.5)
- monitor.clear()
- local function writeLineCentered(y, text, color)
- local w, _ = monitor.getSize()
- local x = math.floor((w - #text) / 2) + 1
- monitor.setCursorPos(x, y)
- monitor.setTextColor(color)
- monitor.write(text)
- end
- while true do
- monitor.clear()
- local _, h = monitor.getSize()
- local startY = math.floor((h - 4) / 2) + 1
- local realTime = textutils.formatTime(os.time("local"), true)
- local gameTime = textutils.formatTime(os.time(), true)
- writeLineCentered(startY, "Real Time", colors.orange)
- writeLineCentered(startY + 1, realTime, colors.green)
- writeLineCentered(startY + 3, "Minecraft Time", colors.orange)
- writeLineCentered(startY + 4, gameTime, colors.green)
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement