Sir_Mr_Bman

dev

Apr 23rd, 2014
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. -- This is to return to craftos
  2. -- Only to be used by developers.
  3.  
  4. local function clear()
  5.   term.setTextColor(colors.yellow)
  6.   term.setBackgroundColor(colors.gray)
  7.   term.clear()
  8.   term.setCursorPos(1, 1)
  9. end
  10.  
  11. clear()
  12. print("WARNING: Developer Tools leaves the security system.")
  13. print("Modifying any files may cause password system to crash.")
  14. print("Because of this, please type your password to continue beyond this point.")
  15. term.setTextColor(colors.red)
  16. term.write(">: ")
  17. local input = read("*")
  18. local h = fs.open("/.bman/pass/pass", "r")
  19. local stringy = h.readAll()
  20. if input == stringy then
  21.   --Terminate shell.
  22.   term.setBackgroundColor(colors.black)
  23.   term.clear()
  24. else
  25.   clear()
  26.   print("Password Incorrect.")
  27.   sleep(3)
  28.   shell.run("/.bman/pass/opt")
  29. end
Advertisement
Add Comment
Please, Sign In to add comment