Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- yes=true
- no=false
- lock="lock"
- unlock="unlock"
- pass="admin"
- monstat=""
- Currentstate=""
- Logged = false
- Lokit = function(bool,state,Cstate)
- redstone.setOutput("back", bool)
- redstone.setOutput("bottom", bool)
- monstat = state
- Currentstate = Cstate
- end
- Lokit(yes,"Locked","Locked")
- mon = peripheral.wrap("top")
- while true do
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write(monstat)
- term.clear()
- term.setCursorPos(1,1)
- if Logged then
- print("Lockdown system activated!")
- print("status: "..Currentstate)
- input = read()
- if input == lock then
- Lokit(yes,"Locked","Locked")
- print("Area now on Lockdown!")
- sleep(1)
- elseif input == unlock then
- Lokit(no,"UNL","Unlocked")
- write("Area Unlocked, watch your back!")
- sleep(1)
- elseif input == "logout" then Logged=false
- end
- if not Logged then
- print ("Please enter the master password!")
- input = read("*")
- if input == pass then Logged = true
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment