Advertisement
Guest User

startup

a guest
Jul 14th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.78 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. pc = peripheral.wrap("computer_449")
  10. pc.turnOn()
  11. term.clear() -- Clears the screen
  12. term.setCursorPos(1, 1) -- The places the print position to the top of screen
  13. username = {"Batponney","Shiranuit","Darktimmy"}  -- Here you need to define all usernames avaible
  14. 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.
  15. i = paintutils.loadImage("interfaceDoor")
  16. paintutils.drawImage(i, 1, 1)
  17. term.setTextColor(colors.orange)
  18. term.setCursorPos(1,1)
  19. write("Welcome To Stage Of Batponney")
  20. term.setCursorPos(1,19)
  21. write("Login Edited By HelixProject")
  22. term.setCursorPos(16,7)
  23. term.setBackgroundColor(colors.black)
  24. write("Username: ")
  25. term.setCursorPos(16,9)
  26. write("Password: ")
  27. term.setCursorPos(26,7)
  28. user = read()
  29. term.setCursorPos(26,9)
  30. pass = read('*') -- This prevents people from reading the password as you put it in
  31.  
  32. for i=1, #username do -- Starts a loop
  33.  if user == username[i] and pass == password[i] then
  34.    access = true
  35.  end
  36. end
  37. if access == true then
  38. term.setBackgroundColor(colors.white)
  39. term.setTextColor(colors.orange)
  40. term.setCursorPos(20,12)
  41. print("Logging in...")
  42. term.setCursorPos(17,12)
  43. print("Welcome "..user)
  44. porte()
  45. term.setCursorPos(15,11)
  46. print(user.." Door is open !")
  47. sleep(2)
  48. os.reboot()
  49. else
  50. term.setCursorPos(10,12)
  51. term.setTextColor(colors.orange)
  52. term.setBackgroundColor(colors.white)
  53. print("Incorrect username and password")
  54. sleep(1)
  55. os.reboot()
  56. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement