View difference between Paste ID: Sd1rfDC8 and bNGXn8Y0
SHOW: | | - or go back to the newest paste.
1
function mysplit (inputstr, sep)
2
        if sep == nil then
3
                sep = "%s"
4
        end
5
        local t={}
6
        for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
7
                table.insert(t, str)
8
        end
9
        return t
10
end
11
term.redirect(peripheral.wrap("top"))
12
13
while true do -- # Main Loop
14
	
15
	term.clear()
16
	term.setCursorPos(1,1)
17
18
	local success, output = commands.exec("season get")
19
--	if success then
20
  --print(output[1])
21
		stringTable = mysplit(output[1])
22
		season=stringTable[4]
23
  season=season:sub(1,-2)
24
  season=string.gsub(season,"_"," ")
25
  season=string.lower(season)
26
  season=string.gsub(" "..season, "%W%l", string.upper):sub(2)
27
		day=stringTable[6]
28
  day=day:sub(1,-2)
29
  print("Day     : " .. os.day())
30
		--print("Time    : " .. textutils.formatTime(os.time(), false))
31
		print("Season  : " .. season)
32
		print("Weekday : " .. day)
33
--	end
34
	sleep(60)	
35
end -- #End Main Loop
36
37
term.restore()