SHARE
TWEET

Untitled

a guest Jul 17th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mainPassword = "password"
  2. if fs.exists("password") then
  3.     local f = fs.open("password","r")
  4.     mainPassword = f.readLine()
  5. end
  6.  
  7. while true do
  8.     term.clear()
  9.     term.setCursorPos(1,1)
  10.     print("Enter your password, or type cp to change it")
  11.     pass = read("*")
  12.    
  13.     if pass == "cp" then
  14.         print("Enter a new password:")
  15.         pass1 = read("*")
  16.         print("Enter the new password again:")
  17.         pass2 = read("*")
  18.         if pass1 == pass2 then
  19.             local f = fs.open("password","w")
  20.             f.writeLine(pass1)
  21.             f.close()
  22.             mainPassword = pass1
  23.         end
  24.        
  25.     end
  26.  
  27.     if pass == mainPassword then
  28.         print("Password Correct")
  29.         redstone.setOutput("left",true)
  30.         sleep(4)
  31.         redstone.setOutput("left",false)
  32.     end
  33. end
RAW Paste Data
Top