Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- requires:
- -- CC restitched 1.76 for minecraft 1.19.2 (fabric loader)
- -- "Source block" from "CC:C bridge"
- -- 4 nixie tube blocks linked to the bridge with a "display link"
- local function fmtTime(time)
- if time == 0 then
- return "00"
- elseif time < 10 then
- return "0" .. tostring(time)
- else
- return tostring(time)
- end
- end
- display = peripheral.find("create_source")
- display.clear()
- while true do
- local time = os.time("utc")
- -- chatgpt slop,,, but it works
- local hours = math.floor(time)
- local mins = math.floor((time - hours) * 60)
- local secs = math.floor(((time - hours) * 60 - mins) * 60)
- local tenths = math.floor((((time - hours) * 60 - mins) * 60 - secs) * 10)
- display.clear()
- display.setCursorPos(1,1) -- source blocks do not do line wrapping etc
- display.write(fmtTime(hours))
- display.write(":")
- display.write(fmtTime(mins))
- display.write(":")
- display.write(fmtTime(secs))
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement