Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local doorSide = "left"
- local alarmSide = "top"
- local password = "open"
- local alarmCode = "stop"
- local opentime = 5
- local alarm = 1
- while true do
- term.clear()
- term.setCursorPos(1,1)
- write("Password: ")
- local input = read("*")
- if input == password then
- term.clear()
- term.setCursorPos(1,1)
- print("Password correct!")
- rs.setOutput(doorSide,true)
- sleep(opentime)
- rs.setOutput(doorSide,false)
- else
- print("Password incorrect!")
- rs.setOutput(alarmSide,true)
- alarm = 2
- sleep(2)
- while alarm = 2 do
- term.clear()
- term.setCursorPos(1,1)
- write("Alarm Reset Code: ")
- local alarmInput = read("*")
- if alarmInput == alarmCode then
- rs.setOutput(alarmSide,false)
- alarm = 1
- print("Alarm Reset")
- sleep(2)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment