Advertisement
coderboy

Lock

Mar 7th, 2015
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. pas = "1234"
  2. redstone.setOutput("left", false)
  3. function unlock()
  4.   redstone.setOutput("left", true)
  5.   sleep(2)
  6.   redstone.setOutput("left", false)
  7. end
  8. function pas()
  9.   print('New Password')
  10.   p = read("*")
  11.   pas = p
  12. end
  13. while true do
  14.   term.clear()
  15.   term.setCursorPos(1, 1)
  16.   print 'password:'
  17.   inp = read("*")
  18.   if inp == pas then
  19.     print('say -unlock- or -pas-')
  20.     print('if you say -pas- it will let you change your password')
  21.     op = read()
  22.     if op == unlock then
  23.         unlock()
  24.     end
  25.     if op == pas then
  26.         pas()
  27.     end
  28.   end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement