Advertisement
ozozx235

clock.lua

Jun 16th, 2021
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. while true do
  2.     sleep(1)
  3.     term.clear()
  4.     term.setCursorPos(1,1)
  5.     date = os.date()
  6.     i=1
  7.     cloc={}
  8.     for w in string.gmatch(date,"[%w:]+") do
  9.         cloc[i]=w
  10.         i=i+1
  11.     end
  12.     print(cloc[1].." "..cloc[2])
  13.     print(cloc[3].." "..cloc[5])
  14.     hour={}
  15.     i=1
  16.     for w in string.gmatch(cloc[4],"%d+") do
  17.         hour[i]=w
  18.         i=i+1
  19.     end
  20.     print(hour[1]..":"..hour[2])
  21.     print(":"..hour[3])
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement