Advertisement
Guest User

startup

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