Advertisement
Guest User

startup

a guest
Nov 23rd, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. local pullevent = os.pullEvent
  2. os.pullEvent = os.pullEventRaw
  3.  
  4. local side = "left"
  5. local password = "lotsofbacon"
  6. local opentime = 5
  7.  
  8. while true do
  9.  term.clear()
  10.  term.setCursorPos(1,1)
  11.  write("Password: ")
  12.  local input = read("*")
  13.  
  14.  if input == "terminate" then
  15.    term.clear()
  16.    term.setCursorPos(1, 1)
  17.    print("You have 10 seconds to terminate the passcode lock with CTRL+T.")
  18.    os.pullEvent = pullevent
  19.    sleep(10)
  20.   end
  21.  
  22.  if input == password then
  23.   term.clear()
  24.   term.setCursorPos(1,1)
  25.   print("Password correct!")
  26.   rs.setOutput(side,true)
  27.   sleep(opentime)
  28.   rs.setOutput(side,false)
  29.  else
  30.   print("Password incorrect!")
  31.   sleep(2)
  32.  end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement