MCFunRide

Door Lock Normal Edition

May 7th, 2015
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. os.loadAPI("/sha256")
  3. if fs.exists("/.funlabslock/") then
  4. door = fs.open("/.funlabslock/.doorside","r")
  5. name = fs.open("/.funlabslock/.name","r")
  6. pass = fs.open("/.funlabslock/.password","r")
  7. time = fs.open("/.funlabslock/.time","r")
  8. total = time.readLine()
  9. term.clear()
  10. term.setCursorPos(1,1)
  11. print(name.readLine())
  12. term.setCursorPos(1,3)
  13. write("Password: ")
  14. password = read('*')
  15. a = sha256.sha256(password)
  16.  
  17. if a == pass.readLine() then
  18. term.setCursorPos(1,5)
  19. print("Correct Password!")
  20. rs.setOutput(door.readLine(),true)
  21. sleep(total)
  22. rs.setOutput(door.readLine(),false)
  23. os.reboot()
  24. else
  25. term.setCursorPos(1,5)
  26. print("Wrong Password!")
  27. sleep(2)
  28. os.reboot()
  29. end
  30. end
Add Comment
Please, Sign In to add comment