Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local seasondone = 0
- month = {
- {mname = "January", mlanth = 31},
- {mname = "February", mlanth = 28},
- {mname = "March", mlanth = 31},
- {mname = "April", mlanth = 30},
- {mname = "May", mlanth = 31},
- {mname = "June", mlanth = 30},
- {mname = "July", mlanth = 31},
- {mname = "August", mlanth = 31},
- {mname = "September", mlanth = 30},
- {mname = "October", mlanth = 31},
- {mname = "November", mlanth = 30},
- {mname = "December", mlanth = 31}
- }
- curmlanth = 0
- while true do
- lockmo = 0
- --local monitor = peripheral.wrap("top")
- --monitor.setTextScale(1)
- local maxW, maxH = term.getSize()
- local nyear = 0
- term.clear()
- term.setCursorPos(1,1)
- local nTime = os.time()
- local time_nospace_zero = string.gsub(textutils.formatTime(os.time(), false), " ", " ")
- local time_nospace_10error = string.gsub(time_nospace_zero, "0:", "12:")
- nTime = string.gsub(time_nospace_10error, "112:", "10:")
- local nDay = os.day()
- local ognday = nDay
- while nDay > 365 do
- nDay = nDay - 365
- nyear = nyear + 1
- end
- lockmday = 0
- local mDay = nDay
- local prevmDay = 0
- curmlanth = 0
- for i=1,#month do
- cordaycnt = 0
- prevmlanth = curmlanth
- curmlanth = curmlanth + month[i].mlanth
- if nDay < curmlanth then
- cordaycnt = cordaycnt + 1
- if nDay > prevmlanth then
- cordaycnt = cordaycnt + 1
- lockmday = 1
- --mDay = mDay + month[i].mlanth
- prevmDay = mDay
- curmonth = i
- break
- end
- end
- if cordaycnt < 5 then
- if lockmday == 0 then
- mDay = mDay - month[i].mlanth
- prevmDay = mDay
- end
- end
- --if mDay < 1 then
- -- mDay = mDay + month[i].mlanth
- -- prevmDay = mDay
- --end
- --if mDay > month[i].mlanth then
- -- mDay = mDay - month[i].mlanth
- -- prevmDay = mDay
- --end
- --if mDay < prevmDay then
- -- curmonth = curmonth + 1
- --end
- lockmday = 0
- end
- --if mDay > month[curmonth].mlanth then
- -- mDay = mDay - month[curmonth].mlanth
- -- prevmDay = mDay
- --end
- term.setCursorPos(1, maxH)
- if ognday < 10000 then
- print("(" .. "Total Days: "..ognday.. ")")
- elseif ognday > 9999 then
- print("(" .. "TotalDays: "..ognday.. ")")
- elseif ognday > 99999 then
- print("(" .. "TotalDays:"..ognday.. ")")
- elseif ognday > 999999 then
- print("(" .. "TtlDs:"..ognday.. ")")
- end
- term.scroll(-1)
- term.setCursorPos(1,1)
- print(nTime)
- term.setCursorPos(1,2)
- print(mDay.." "..month[curmonth].mname)
- term.setCursorPos(1,3)
- print("Year " .. nyear)
- local ndaylc = string.len("Day " .. nDay)
- ndaylc = ndaylc - 1
- term.setCursorPos(maxW - ndaylc,3)
- print("Day " .. nDay)
- if month[curmonth].mname == "june" then
- if mDay == 1 then
- commands.exec("sereneseasons setseason early_summer")
- seasondone = 1
- end
- end
- local mineminute = 60 / 72
- local mineminute2 = mineminute * 10
- sleep(mineminute2)
- if seasondone == 1 then
- sleep(1260)
- seasondone = 0
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement