Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local hello = "" --Put Password In Here
- local opentime = 3 --Put How long you want the door open Here
- local hi = "" --Put Admin Password In Here (Cannot be same as main)
- local left = "" --Put the Side where you door or redstone is
- --os.pullEvent = os.pullEventRaw
- --Remove the '--' at the beginning of the previous
- --line to prevent people from terminating your
- --lock. Then add "shell.run("[name of this program here]")
- --to auto start this program.
- --THIS WILL PREVENT YOU FROM EDITING THE PROGRAM
- --ANY FURTHER. DO NOT DO THIS WITHOUT ENSURING
- --THE PROGRAM WORKS.
- --DO NOT EDIT BELOW THIS LINE--
- doorlock = false
- function mainP()
- term.clear()
- term.setCursorPos(1,1)
- print("Enter Password: ")
- input = read("*")
- if input == password then
- if doorlock == false then
- print("Door Opened")
- rs.setOutput(rside, true)
- sleep(opentime)
- print("Door Closed")
- rs.setOutput(rside, false)
- sleep(1)
- else
- print("Door Lock Enabled. Cannot Open Door")
- sleep(1)
- mainP()
- end
- elseif input == apasswrd then
- admin()
- else
- print("Incorrect Password. Please Try Again")
- sleep(2)
- end
- end
- function admin()
- term.clear()
- term.setCursorPos(1,1)
- print("Enter Command: ")
- local input = read()
- if input == "Help" then
- term.clear()
- term.setCursorPos(1,1)
- print("Commands: ")
- term.setCursorPos(1,2)
- print("Help - Displays this dialog")
- term.setCursorPos(1,3)
- print("Open - Opens the door (Bypasses lock)")
- term.setCursorPos(1,4)
- print("Close - Closes the door")
- term.setCursorPos(1,5)
- print("Lock - Locks the door")
- term.setCursorPos(1,6)
- print("Unlock - Unlocks the door")
- term.setCursorPos(1,7)
- print("Show Password - Shows the password to open the door")
- term.setCursorPos(1,8)
- print("Home - Returns to the main password screen")
- sleep(10)
- admin()
- elseif input == "Open" then
- rs.setOutput(rside, true)
- sleep(1)
- admin()
- elseif input == "Close" then
- rs.setOutput(rside, false)
- sleep(1)
- admin()
- elseif input == "Lock" then
- doorlock = true
- sleep(1)
- admin()
- elseif input == "Unlock" then
- doorlock = false
- sleep(1)
- admin()
- elseif input == "Show Password" then
- print(password)
- sleep(3)
- admin()
- elseif input == "Home" then
- mainP()
- end
- end
- while true do
- mainP()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement