Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Program named "startup"
- local
- mon = peripheral.wrap("top")
- minute = ""
- second = ""
- term.clear()
- term.setCursorPos(1, 1)
- print("-~- How much time? -~-")
- print(" ")
- term.write("Minutes: ")
- minute = read()
- term.write("Seconds: ")
- second = read()
- if second >= 60 then -- Error here. "test:20: attempt to compare string with number expected, got string"
- print("Too many seconds. Please choose a number under 60.")
- sleep(3)
- os.reboot()
- end
- term.clear()
- term.setCursorPos(1, 1)
- while redstone.getInput("back")==false do
- term.redirect(peripheral.wrap("top"))
- mon.setTextScale(2)
- term.clear()
- term.setCursorPos(1, 1)
- print(minute..":"..second)
- sleep(.5)
- print(minute.." "..second) -- Adds blinking effect to ":"
- end
- if redstone.getInput("back") then
- term.redirect(peripheral.wrap("top"))
- if second < 0 then
- minute = minute-1
- end
- if second < 0 then
- second = 59
- end
- if minute==0 and second==0 then
- os.reboot()
- end
- for i = 1, 60 do
- term.redirect(peripheral.wrap("top"))
- mon.setTextScale(2)
- term.clear()
- term.setCursorPos(1, 1)
- print(minute..":"..second)
- sleep(1)
- second = second-1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment