Advertisement
Guest User

time.lua

a guest
Apr 14th, 2025
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. local monitor = peripheral.find("monitor")
  2. monitor.setTextScale(1.5)
  3. while(true) do
  4.   monitor.clear()
  5.   monitor.setCursorPos(1, 1)
  6.   monitor.write("Current Time")
  7.   monitor.setCursorPos(1, 2)
  8.   if(os.time("local") < 10.0) then
  9.     monitor.write("0")
  10.   end
  11.   if(os.time("local") >= 22.0) then
  12.     monitor.write("--> ")
  13.   end
  14.   monitor.write(textutils.formatTime(os.time("local"), true))
  15.   if(os.time("local") >= 22.0) then
  16.     monitor.write(" <--")
  17.   end
  18.    
  19.   monitor.setCursorPos(1, 4)
  20.   monitor.write("Minecraft Time")
  21.   monitor.setCursorPos(1, 5)
  22.   if(os.time() < 10.0) then
  23.     monitor.write("0")
  24.   end
  25.   monitor.write(textutils.formatTime(os.time(), true))  
  26.  
  27.   os.sleep(0.1)
  28. end
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement