SHOW:
|
|
- or go back to the newest paste.
| 1 | while true do | |
| 2 | - | local monitor = peripheral.wrap("top")
|
| 2 | + | local monitor = peripheral.wrap("top")
|
| 3 | - | monitor.setTextScale(1) |
| 3 | + | monitor.setTextScale(1) |
| 4 | local maxW, maxH = term.getSize() | |
| 5 | - | term.clear() |
| 5 | + | local nyear = 0 |
| 6 | - | term.setCursorPos(1,1) |
| 6 | + | term.clear() |
| 7 | - | local nTime = os.time() |
| 7 | + | term.setCursorPos(1,1) |
| 8 | - | local nDay = os.day() |
| 8 | + | local nTime = os.time() |
| 9 | - | print("" .. textutils.formatTime(nTime, false))
|
| 9 | + | local time_nospace_zero = string.gsub(textutils.formatTime(os.time(), false), " ", " ") |
| 10 | - | print("Day " .. nDay)
|
| 10 | + | local time_nospace_10error = string.gsub(time_nospace_zero, "0:", "12:") |
| 11 | - | sleep(0.1) |
| 11 | + | nTime = string.gsub(time_nospace_10error, "112:", "10:") |
| 12 | - | end |
| 12 | + | local nDay = os.day() |
| 13 | local ognday = nDay | |
| 14 | while nDay > 365 do | |
| 15 | nDay = nDay - 365 | |
| 16 | nyear = nyear + 1 | |
| 17 | end | |
| 18 | term.setCursorPos(1, maxH) | |
| 19 | if ognday < 10000 then | |
| 20 | print("(" .. "Total Days: "..ognday.. ")")
| |
| 21 | elseif ognday > 9999 then | |
| 22 | print("(" .. "TotalDays: "..ognday.. ")")
| |
| 23 | elseif ognday > 99999 then | |
| 24 | print("(" .. "TotalDays:"..ognday.. ")")
| |
| 25 | elseif ognday > 999999 then | |
| 26 | print("(" .. "TtlDs:"..ognday.. ")")
| |
| 27 | end | |
| 28 | term.scroll(-1) | |
| 29 | term.setCursorPos(1,1) | |
| 30 | print(nTime) | |
| 31 | term.setCursorPos(1,2) | |
| 32 | print("Day " .. nDay)
| |
| 33 | term.setCursorPos(1,3) | |
| 34 | print("Year " .. nyear)
| |
| 35 | ||
| 36 | sleep(0.833333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333328) | |
| 37 | end |