Advertisement
Guest User

Data center lock

a guest
Feb 10th, 2016
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2.  
  3.  
  4. local side = "left"
  5.  
  6. local password = "This is not my password"
  7.  
  8. local opentime = 5
  9.  
  10. term.clear()
  11.  
  12. term.setCursorPos(1,1)
  13.  write("Password: ")
  14.  
  15.   local input = read("*")
  16.  
  17.  
  18.    if input == password then
  19.     term.clear()
  20.       term.setCursorPos(1,1)
  21.        print("Password correct!")
  22.         rs.setOutput(side,true)
  23.          sleep(opentime)
  24.           rs.setOutput(side,false)
  25.           else
  26.            print("Password incorrect!")
  27.            sleep(2) -- Waits 2 seconds
  28.            os.reboot()
  29.             end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement