Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- print("Hello")
- sleep(2)
- print("What would you like to do?")
- sleep(2)
- print("1 = Blue Light")
- print("2 = Red Light")
- print("3 = Green Light")
- print("4 = Yellow Light")
- code = read("*")
- write("")
- if code == "1" then
- rs.setOutput("top",true)
- print("Enter Passcode")
- pass = read("*")
- write("")
- if pass == "hi" then
- print("Thank You")
- rs.setOutput("top",true)
- sleep(5)
- rs.setOutput("top",false)
- repeat
- until "i==3"
- else
- print("Wrong Passcode")
- sleep(3)
- os.shutdown()
- repeat
- until "i==3"
- end
- elseif code == "2" then
- print("Enter Passcode")
- second = read("*")
- write("")
- if second == "hi" then
- print("Thank You")
- rs.setOutput("right",true)
- sleep(5)
- rs.setOutput("right",false)
- os.shutdown()
- else
- print("Wrong Passcode")
- sleep(3)
- os.shutdown()
- repeat
- until "i==3"
- end
- elseif code == "3" then
- print("Enter Passcode")
- third = read("*")
- write("")
- if third == "hi" then
- rs.setOutput("bottom",true)
- print("Thank You")
- sleep(5)
- rs.setOutput("bottom",false)
- os.shutdown()
- else
- print("Wrong Passcode")
- sleep(3)
- os.shutdown()
- repeat
- until "i==3"
- end
- elseif code == "4" then
- print("Enter Passcode")
- forth = read("*")
- if forth == "hi" then
- rs.setOutput("left",true)
- print("Thank You")
- sleep(5)
- rs.setOutput("left",false)
- os.shutdown()
- else
- print("Wrong Passcode")
- sleep(3)
- os.shutdown()
- repeat
- until "i==3"
- end
- else
- print("Wrong Input")
- sleep(3)
- os.shutdown()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement