Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function mysplit (inputstr, sep)
- if sep == nil then
- sep = "%s"
- end
- local t={}
- for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
- table.insert(t, str)
- end
- return t
- end
- term.redirect(peripheral.wrap("top"))
- while true do -- # Main Loop
- term.clear()
- term.setCursorPos(1,1)
- local success, output = commands.exec("season get")
- -- if success then
- --print(output[1])
- stringTable = mysplit(output[1])
- season=stringTable[4]
- season=season:sub(1,-2)
- season=string.gsub(season,"_"," ")
- season=string.lower(season)
- season=string.gsub(" "..season, "%W%l", string.upper):sub(2)
- day=stringTable[6]
- day=day:sub(1,-2)
- print("Day : " .. os.day())
- --print("Time : " .. textutils.formatTime(os.time(), false))
- print("Season : " .. season)
- print("Weekday : " .. day)
- -- end
- sleep(60)
- end -- #End Main Loop
- term.restore()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement