ericl16384

ComputerCraft - PasswordPistonDoor

Jun 8th, 2020
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local program = [[
  2.     os.pullEvent = os.pullEventRaw
  3.     redstone.setOutput("back", true)
  4.     while true do
  5.         term.clear()
  6.         term.setCursorPos(1, 1)
  7.         print("Password?")
  8.         if read("*") == password then
  9.             redstone.setOutput("back", false)
  10.             sleep(2)
  11.             redstone.setOutput("back", true)
  12.         end
  13.     end
  14. ]]
  15.  
  16. print("Password?")
  17. local password = read()
  18.  
  19. if response then        
  20.     local file = fs.open("startup.lua", "w")
  21.     file.write("local password = \""..password.."\"\n"..program)
  22.     file.close()
  23. end
  24.  
  25. -- Finish
  26. os.reboot()
Add Comment
Please, Sign In to add comment