Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DIGIT = 1
- SEGMENT = 1
- seg = {}
- seg[1] = '23567890'
- seg[2] = '456890'
- seg[3] = '12347890'
- seg[4] = '2345689'
- seg[5] = '2680'
- seg[6] = '134567890'
- seg[7] = '2356890'
- while true do
- if os.time()%1*100*6 >= 99 then
- mins = string.sub(tostring(os.time()%1*100*6), 1, 2)
- else
- mins = '0'..string.sub(tostring(os.time()%1*100*6), 1, 1)
- end
- if os.time() - os.time()%1 > 9 then
- hours = tostring(os.time() - os.time()%1)
- else
- hours = '0'..tostring(os.time() - os.time()%1)
- end
- time = hours .. mins
- term.setCursorPos(1, 1)
- term.clear()
- print(os.time())
- print(time)
- if string.match(seg[SEGMENT], string.sub(time, DIGIT, DIGIT)) then
- redstone.setOutput('left', true)
- else
- redstone.setOutput('left', false)
- end
- sleep(1)
- end
Add Comment
Please, Sign In to add comment