ThatGravyBoat

Untitled

Jan 30th, 2022 (edited)
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. local controller = peripheral.find('arController')
  2. while true do
  3. controller.clear()
  4.  
  5. local time = math.floor(os.time())
  6. local timeSuffix
  7. if os.time() < 12 then
  8. timeSuffix = "am"
  9. else
  10. timeSuffix = "pm"
  11. end
  12.  
  13. local endTime
  14. local endTimeNum = math.floor(60*(os.time() % 1))
  15. if endTimeNum < 10 then
  16. endTime = "0" .. tostring(endTimeNum)
  17. else
  18. endTime = tostring(endTimeNum)
  19. end
  20.  
  21. controller.drawItemIcon("minecraft:clock", 4, 4)
  22.  
  23. controller.drawString(tostring(time % 12) .. ":" .. endTime .. timeSuffix, 20, 8, 16777215)
  24.  
  25. os.sleep(0.25)
  26. end
Advertisement
Add Comment
Please, Sign In to add comment