Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MAX_TIME = 120
- while true do
- term.setCursorPos(1, 1)
- term.clear()
- print('Set timer in seconds:')
- input = tonumber(read())
- if input > MAX_TIME then
- input = MAX_TIME
- print(MAX_TIME .. ' is the max amount!')
- end
- timer = 0
- while timer < input do
- redstone.setOutput('back', true)
- sleep(0.5)
- timer = timer + 0.5
- x, y = term.getCursorPos()
- term.setCursorPos(1, y)
- term.write('[')
- for n = 2, timer*50/input-2 do
- term.setCursorPos(n, y)
- term.write('|')
- end
- term.setCursorPos(50, y)
- term.write(']')
- end
- redstone.setOutput('back', false)
- end
Add Comment
Please, Sign In to add comment