ThatGravyBoat

Untitled

Feb 1st, 2022 (edited)
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. local controller = peripheral.find('arController')
  2. local detector = peripheral.find("environmentDetector")
  3.  
  4. controller.drawItemIcon("minecraft:clock", 4, 4)
  5.  
  6. while true do
  7. local timeseconds = math.floor((detector.getTime() % 24000) / 20)
  8.  
  9. local endTime
  10. local endTimeNum = math.floor(60*((timeseconds / 60) % 1))
  11. if endTimeNum < 10 then
  12. endTime = "0" .. tostring(endTimeNum)
  13. else
  14. endTime = tostring(endTimeNum)
  15. end
  16.  
  17. controller.clearElement("clock_text")
  18. controller.drawStringWithId("clock_text", tostring(math.floor(timeseconds / 60)) .. ":" .. endTime, 20, 8, 16777215)
  19.  
  20. os.sleep(0.25)
  21. end
Advertisement
Add Comment
Please, Sign In to add comment