Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- local Password = "password"
- local Owner = "n"
- local Side = "front"
- local function Clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function Lock()
- redstone.setOutput(Side,false)
- Clear()
- print(Owner,"’S locker")
- print("enter Passcode")
- local User
- local event
- while true do
- local event = {os.pullEvent("key")}
- if event[2] == keys.enter then break end
- User = read()
- end
- if Password == Password then
- Menu()
- else
- Lock()
- end
- end
- function Menu()
- Clear()
- print("==Options==")
- print(" 1 - open/close")
- print(" 2 - lock")
- print(" 5 - console")
- local event
- repeat
- event = {os.pullEvent("key")}
- until event[2] == keys.one or event[2] == keys.two or event[2] == keys.five
- if event[2] == keys.one then
- if redstone.getOutput(Side) == true then redstone.setOutput(Side,false) else redstone.setOutput(Side,true) end
- Menu()
- elseif event[2] == keys.two
- Lock()
- elseif event[2] == keys.five
- exit
- end
- end
- Lock()
Add Comment
Please, Sign In to add comment