Advertisement
Guest User

startup

a guest
Oct 3rd, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.55 KB | None | 0 0
  1. --Variables.
  2. local version = ("1.0") --Version
  3. local os = ("DankOS") --Operating System
  4. local username = ("tomte55")
  5. local password = ("sty595")
  6. local input1 = ("")
  7. local input2 = ("")
  8.  
  9. --Functions.
  10. function boot() --Boot function.
  11.   term.clear()
  12.   term.setCursorPos(1,1)
  13.   term.setTextColor(colors.cyan)
  14.   print("|------------|")
  15.   print("|"..os.." "..version.."  |")
  16.   print("|------------|")
  17.   print("")
  18. end
  19.  
  20. function clear() --Clear function.
  21.   term.clear()
  22.   term.setCursorPos(1,1)
  23. end
  24.  
  25. function loading() --Loading function.
  26. colorC()
  27.   write("Loading")
  28.   textutils.slowPrint("[::::::::::::]",10)
  29.   sleep(1)
  30.   clear()
  31. colorW()
  32. end
  33.  
  34. --TEXT COLOR FUNCTIONS.
  35. function colorW() --White text function.
  36.   term.setTextColor(colors.white)
  37. end
  38.  
  39. function colorG() --Green text function.
  40.   term.setTextColor(colors.green)
  41. end
  42.  
  43. function colorR() --Red text function
  44.   term.setTextColor(colors.red)
  45. end
  46.  
  47. function colorC() --Cyan text function
  48.   term.setTextColor(colors.cyan)
  49. end
  50.  
  51. --Login setup.
  52. loading()
  53. boot()
  54. colorW()
  55.   textutils.slowPrint("Welcome to "..(version))
  56. sleep(1)
  57.   term.write("Username: ")
  58.     input1 = read()
  59.   term.write("Password: ")
  60.     input2 = read("*")
  61. if input1 == username then
  62.   if input2 == password then
  63.     colorG()
  64.     print("Correct")
  65.     colorW()
  66. else
  67.   colorR()
  68.   print("Incorrect password!")
  69.   colorW()
  70.   colorC()
  71.   print("Rebooting in 3...")
  72.   sleep(1)
  73.   print("Rebooting in 2...")
  74.   sleep(1)
  75.   print("Rebooting in 1...")
  76.   sleep(1)
  77.   os.reboot()
  78.   end
  79. end
  80.  
  81. sleep(2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement