Advertisement
JustinzocktYT

Real-Time clock in Minecraft using local time for Opencomputers Mod (1.7.10)

Jan 28th, 2023
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | Source Code | 0 0
  1. local component = require("component")
  2. local gpu = component.gpu
  3.  
  4. while true do
  5. local time = os.time()
  6. local hour = math.floor(time / 3600) % 24
  7. local minute = math.floor(time / 60) % 60
  8. local second = time % 60
  9. gpu.set(1, 1, string.format("%02d:%02d:%02d", hour, minute, second))
  10. os.sleep(1)
  11. end
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement