Advertisement
DerriDaX

CC Test

Jul 30th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. local password = 'admin' --Set your password here
  2. local side = 'left'      --Side in which door is
  3. local opentime = 3       --How long door will remain open
  4.  
  5. while true do
  6.     term.clear()
  7.     term.setCursorPos(1,1)
  8.     term.write('Enter password: ')
  9.     local input = read('*')
  10.    
  11.     if input == password then
  12.         print('Password correct, unlocking door...')
  13.         rs.setOutput(side, true)
  14.         sleep(opentime)
  15.         rs.setOutput(side, false)
  16.         term.clear()
  17.         term.setCursorPos(1,1)
  18.         print('Welcome to CraftOS 1.7!')
  19.         error()
  20.     else
  21.         print('Password incorrect!')
  22.         sleep(2)
  23.     end
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement