Advertisement
Guest User

startup

a guest
Jun 17th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.73 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw -- Prevents CTRL+T shortcut
  2. local function porte()
  3. local computer = {"computer_436","computer_438","computer_437","computer_434","computer_435","computer_433"}
  4.     for n = 1,6 do
  5.         m = peripheral.wrap (computer[n])
  6.         m.turnOn()
  7.     end
  8. end
  9.  
  10. term.clear() -- Clears the screen
  11. term.setCursorPos(1, 1) -- The places the print position to the top of screen
  12. username = {"Batponney","Shiranuit","Darktimmy"}  -- Here you need to define all usernames avaible
  13. password = {"BatbotInc","HelixProject","Artange"}  -- Here you define what password each user has, remember to put user1's password in the first row and so on.
  14. i = paintutils.loadImage("interfaceDoor")
  15. paintutils.drawImage(i, 1, 1)
  16. term.setTextColor(colors.orange)
  17. term.setCursorPos(1,1)
  18. write("Welcome To Stage Of Batponney")
  19. term.setCursorPos(1,19)
  20. write("Login Edited By HelixProject")
  21. term.setCursorPos(16,7)
  22. term.setBackgroundColor(colors.black)
  23. write("Username: ")
  24. term.setCursorPos(16,9)
  25. write("Password: ")
  26. term.setCursorPos(26,7)
  27. user = read()
  28. term.setCursorPos(26,9)
  29. pass = read('*') -- This prevents people from reading the password as you put it in
  30.  
  31. for i=1, #username do -- Starts a loop
  32.  if user == username[i] and pass == password[i] then
  33.    access = true
  34.  end
  35. end
  36. if access == true then
  37. term.setBackgroundColor(colors.white)
  38. term.setTextColor(colors.orange)
  39. term.setCursorPos(20,12)
  40. print("Logging in...")
  41. term.setCursorPos(17,12)
  42. print("GoodBye "..user)
  43. porte()
  44. term.setCursorPos(15,11)
  45. print(user.." Door is open !")
  46. sleep(2)
  47. os.reboot()
  48. else
  49. term.setCursorPos(10,12)
  50. term.setTextColor(colors.orange)
  51. term.setBackgroundColor(colors.white)
  52. print("Incorrect username and password")
  53. sleep(1)
  54. os.reboot()
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement