Advertisement
Weidus

Untitled

May 27th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. local side = "bottom"
  2. local pseudo = ""
  3. local pass = ""
  4.  
  5. monitor = peripheral.wrap("top")
  6. monitor.setTextScale(0.8)
  7. monitor.setCursorPos(1,0)
  8.  
  9. redstone.setBundledOutput(side, colors.lime+colors.red)
  10.  
  11. while true do
  12. term.setCursorPos(1,1)
  13. term.setTextColor(colors.white)
  14. term.clear()
  15.  
  16. print("Pseudo :")
  17. pseudo = read()
  18. print("Mot de passe :")
  19. pass = read()
  20.  
  21. if pseudo == "exit" then
  22. monitor.clear()
  23. break
  24.  
  25. elseif pseudo == "open" then
  26. redstone.setBundledOutput(side, colors.red)
  27. sleep(3)
  28. redstone.setBundledOutput(side, colors.lime+colors.red)
  29.  
  30. term.setTextColor(colors.red)
  31. print("Ouverture")
  32.  
  33. elseif pseudo == "close" then
  34. redstone.setBundledOutput(side, colors.lime)
  35. sleep(3)
  36. redstone.setBundledOutput(side, colors.lime+colors.red)
  37.  
  38. term.setTextColor(colors.red)
  39. print("Fermeture")
  40.  
  41. elseif pass == "caribou" then
  42. local cX, cY = monitor.getCursorPos()
  43. monitor.setCursorPos(1, cY+1)
  44.  
  45. local time = os.time()
  46. local formattedTime = textutils.formatTime(time, false)
  47. monitor.write(pseudo .. " : " .. formattedTime .. " -> Ouverture")
  48.  
  49. term.setTextColor(colors.red)
  50. print("Ouverture en cours ..")
  51.  
  52. redstone.setBundledOutput(side, colors.red)
  53. sleep(3)
  54. redstone.setBundledOutput(side, colors.lime+colors.red)
  55.  
  56. sleep(10)
  57.  
  58. redstone.setBundledOutput(side, colors.lime)
  59. sleep(3)
  60. redstone.setBundledOutput(side, colors.lime+colors.red)
  61.  
  62. else
  63. term.setTextColor(colors.red)
  64. print("Mot de passe incorrect !")
  65.  
  66. local cX, cY = monitor.getCursorPos()
  67. monitor.setCursorPos(1, cY+1)
  68.  
  69. local time = os.time()
  70. local formattedTime = textutils.formatTime(time, false)
  71. monitor.write(pseudo .. " : " .. formattedTime .. " -> Erreur")
  72.  
  73. sleep(2)
  74. end
  75. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement