Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local side = "right"
- local riddle = "What is life's greatest illusion?"
- local password = "Innocence, my brother."
- local opentime = 3
- local pullEvent = os.pullEvent
- os.pullEvent = os.pullEventRaw
- while true do
- term.clear()
- term.setCursorPos(1,1)
- write(riddle)
- term.setCursorPos(1,2)
- write("Answer: ")
- local input = read("*")
- if rs.getInput("front") == true then
- term.clear()
- term.setCursorPos(1,1)
- print("Override successful. Welcome.")
- rs.setOutput(side,true)
- os.pullEvent = pullEvent
- sleep(opentime) -- Wait the amount of seconds you specifed, then..
- os.pullEvent = os.pullEventRaw
- rs.setOutput(side,false)
- elseif input == password then
- term.clear()
- term.setCursorPos(1,1)
- print("Welcome.")
- rs.setOutput(side,true)
- sleep(opentime) -- Wait the amount of seconds you specifed, then..
- rs.setOutput(side,false)
- else
- print("Incorrect. Leave at once!")
- sleep(2) -- Waits 2 seconds
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement