Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local running = true
- local numFails = 0
- while running == true do
- term.clear ()
- print ("What would you like to do?")
- print ("")
- print ("Open")
- print ("Close")
- print ("Exit")
- print ("")
- local input = read ("*")
- if input == "Open" then
- print ("Enter password: ")
- local passInput read ("*")
- if passInput == "password" then
- print ("Password correct.")
- print ("Door opening...")
- redstone.setOutput ("back", true)
- sleep (4)
- redstone.setOutput ("back", false)
- redstone.setOutput ("left", true)
- sleep (1)
- redstone.setOutput ("left", false)
- print ("Exiting...")
- running = false
- else
- print ("Password incorrect.")
- if numFails >= 3 then
- ActivateSec ()
- numFails = 0
- end
- print ("Exiting...")
- running = false
- end
- elseif input == "Close" then
- print ("Enter password: ")
- local passInput read ("*")
- if passInput == "password" then
- print ("Password correct.")
- print ("Door closing...")
- redstone.setOutput ("left", true)
- sleep (1)
- redstone.setOutput ("left", false)
- redstone.setOutput ("back", true)
- sleep (4)
- redstone.setOutput ("back", false)
- print ("Exiting...")
- running = false
- else
- print ("Password incorrect.")
- if numFails >= 3 then
- ActivateSec ()
- numFails = 0
- end
- print ("Exiting...")
- running = false
- end
- elseif input == "Exit" then
- print ("Exiting...")
- running = false
- else
- print ("Sorry, did not recognise that input...")
- print ("Exiting...")
- running = false
- end
- end
- sleep (3)
- term.clear ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement