Guest User

test

a guest
Dec 23rd, 2013
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 0 0
  1. redstone.setOutput("left", true)
  2. correctpassword = "codered"
  3. pin = "0759"
  4. write("What is the current situation? ")
  5. logtime = (os.time())
  6.  
  7. local input = read("*")
  8.  
  9. if input == (correctpassword) then
  10. write("Password correct!")
  11. redstone.setOutput("right", true)
  12. sleep(5)
  13. redstone.setOutput("right", false)
  14. write("Are you sure? Enter pin ")
  15. input = read("*")
  16.   if input == (pin) then
  17.   write("Access granted.")
  18.   redstone.setOutput("bottom", true)
  19.   else
  20.   write("Incorrect! Your attempt has been logged...")
  21.   local file = fs.open("log", "w")
  22.   file.write("Last attempt:"..logtime)
  23.   file.close()
  24.   print("Logged.")
  25.   sleep(5)
  26.   os.shutdown()
  27.   end
  28. elseif input == "editit" then
  29. write("Launching editing mode...")
  30. write("")
  31.  
  32. end
Advertisement
Add Comment
Please, Sign In to add comment