Advertisement
MeLike2D

Password Program (Only Advanced Monitors)

Dec 29th, 2017
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2.  
  3. while true do
  4.    
  5.     term.clear()
  6.     term.setTextColor(colors.red)
  7.     term.setCursorPos(3,2)
  8.     term.write("Password: ")
  9.     local password = read("#")
  10.    
  11.     if password == "password" then
  12.           term.clear()
  13.           print("Hello Player")
  14.           redstone.setOutput("right", true)
  15.           sleep(2)
  16.           redstone.setOutput("right", false)
  17.           os.shutdown()
  18.      else
  19.           term.clear()
  20.           term.setBackgroundColor(colors.white)
  21.           term.setTextColor(colors.black)
  22.           print("Wrong Password")
  23.           sleep(2)
  24.           print("Shutting Down")
  25.           sleep(2)
  26.           os.shutdown()
  27.        end      
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement