Advertisement
exploder2013

Tekkit - OS security

Sep 13th, 2012
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.29 KB | None | 0 0
  1. --Save this file as startup on your computer.
  2. --The default password is "test", you can change it by modifying the pass = "yourpassword".
  3. --I might create a better verstion after.
  4. --Fixed all flaws, and it's working perfect now, have fun.
  5.  
  6.  
  7. os.pullEvent = os.pullEventRaw
  8. term.clear()
  9. term.setCursorPos(1,5)
  10. while true do
  11. print("                +-----------------+")
  12. print("                : Security System :")
  13. print("                :   By Exploder   :")
  14. print("                +-----------------+")
  15. print("                :1.Access Computer:")
  16. print("                :2.Exit           :")
  17. print("                +-----------------+")
  18. term.setCursorPos(1,5)
  19. event, param1, param2 = os.pullEvent()
  20. if event == "char" and param1 == "1" then access() end
  21. if event == "char" and param1 == "2" then quit() end
  22.  
  23.  
  24. function access()
  25. term.clear()
  26. term.setCursorPos(1,1)
  27. pass = "test" --Here you can type your own password.
  28. print("Enter Password")
  29. term.setCursorPos(1,3)
  30. write("Password:")
  31. input = read("*")
  32. if input == pass then
  33. term.setCursorPos(1,5)
  34. print("Password is correct, granting access.")
  35. sleep(1)
  36. term.clear()
  37. term.setCursorPos(1,1)
  38. error()
  39. else
  40. term.setCursorPos(1,5)
  41. print("Password is incorrect.")
  42. sleep(2)
  43. os.shutdown()
  44. end
  45. end
  46.  
  47. function quit()
  48. os.shutdown()
  49. end
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement