Advertisement
Guest User

startup

a guest
Apr 20th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.27 KB | None | 0 0
  1. ------------------SecureStart 1.1-----------------
  2. os.pullEvent = os.pullEventRaw
  3. function secureStart()
  4.  for n,sSide in pairs(redstone.getsides()) do
  5.  if disk.isPresent(sSide) and disk.hasData(sSide)
  6.  then
  7.  fs.delete(disk.getMountPath(sSide))
  8.  end
  9.  end
  10. end
  11. function clearSCR() -- Clears screen
  12.  term.clear()
  13.  term.setCursorPos(1,1)
  14. end
  15. function textColour()
  16.  term.setTextColor(colors.yellow)
  17. end
  18. function Pass() -- Sets password variable
  19.  password = "TheBlackPlaguE2017*"
  20. end
  21. function askPass() -- Asks for password
  22.  textutils.slowWrite("Please enter the password: ")
  23. end
  24. function receivePass() -- Reads for input
  25.  username = "TheWhiteKhan"
  26.  greet = "Welcome, "
  27.  welcome = greet..username
  28.  input = read("*")
  29.  if input == password then
  30.  clearSCR()
  31.  term.setTextColor(colors.green)
  32.  textutils.slowPrint("Login Successful")
  33.  sleep(0.5)
  34.  clearSCR()
  35.  term.setTextColor(colors.orange)
  36.  textutils.slowPrint(welcome)
  37.  sleep(0.5)
  38.  else
  39.  clearSCR()
  40.  term.setTextColor(colors.red)
  41.  textutils.slowPrint("Login Insuccessful")
  42.  sleep(0.5)
  43.  clearSCR()
  44.  textutils.slowPrint("Shutting down")
  45.  sleep(1)
  46.  os.shutdown()
  47.  end
  48. end
  49.  
  50. ------------------PROGRAM BEGINS------------------
  51.  
  52. secureStart()
  53. clearSCR()
  54. textColour()
  55. Pass()
  56. askPass()
  57. receivePass()
  58. clearSCR()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement