Advertisement
Guest User

startup

a guest
Aug 31st, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. local side = "back"
  2. local pass = "visit"
  3. local opentime = 7
  4. local pullEvent = os.pullEvent
  5. os.pullEvent = os.pullEventRaw
  6. while true do
  7.   term.clear()
  8.   term.setCursorPos(1,1)
  9.   write("Password: ")
  10.   local input = read("*")
  11.   if input == pass then
  12.     term.clear()
  13.     term.setCursorPos(1,1)
  14.     print("Access Granted!")
  15.     os.pullEvent = pullEvent
  16.     rs.setOutput(side,true)
  17.     sleep(opentime)
  18.     rs.setOutput(side,false)
  19.   else
  20.     print("Accsess Denied")
  21.     sleep(2)
  22.   end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement