Advertisement
lego11

Untitled

Mar 29th, 2021
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.90 KB | None | 0 0
  1. -- Elevator Controller by dionesalvi @ Calafrica Group
  2. -- Product Key: AJGFGR543
  3.  
  4.  
  5. lato = "left"
  6.  
  7. term.clear()
  8. term.setCursorPos(1, 2)
  9. term.write("Benvenuto!")
  10. term.setCursorPos(1, 3)
  11. term.write("Seleziona un piano:")
  12.  
  13. term.setCursorPos(1, 6)
  14. term.setBackgroundColor(colors.magenta)
  15. term.write(" * Primo Piano ")
  16.  
  17. term.setCursorPos(1, 8)
  18. term.setBackgroundColor(colors.lightBlue)
  19. term.write(" * Secondo Piano ")
  20.  
  21. term.setCursorPos(1, 10)
  22. term.setBackgroundColor(colors.yellow)
  23. term.setTextColor(colors.black)
  24. term.write(" * Terzo Piano ")
  25. term.setTextColor(colors.white)
  26.  
  27. term.setCursorPos(1, 12)
  28. term.setBackgroundColor(colors.lime)
  29. term.write(" * Quarto Piano ")
  30.  
  31. term.setCursorPos(1, 14)
  32. term.setBackgroundColor(colors.pink)
  33. term.write(" * Quinto Piano ")
  34.  
  35. term.setCursorPos(1, 16)
  36. term.setBackgroundColor(colors.blue)
  37. term.write(" * Sesto Piano ")
  38.  
  39. while true do
  40. _, button, x, y = os.pullEvent("mouse_click")
  41. if (x >= 1 and x <= 17) then
  42. if y == 6 then
  43. rs.setBundledOutput(lato, colors.red)
  44. os.sleep(3)
  45. rs.setBundledOutput(lato, 0)
  46. elseif y == 8 then
  47. rs.setBundledOutput(lato, colors.magenta)
  48. os.sleep(5)
  49. rs.setBundledOutput(lato, 0)
  50. elseif y == 10 then
  51. rs.setBundledOutput(lato, colors.purple)
  52. os.sleep(7)
  53. rs.setBundledOutput(lato, 0)
  54. elseif y == 12 then
  55. rs.setBundledOutput(lato, colors.white)
  56. os.sleep(9)
  57. rs.setBundledOutput(lato, 0)
  58. elseif y == 14 then
  59. term.setBackgroundColor(colors.black)
  60. term.clear()
  61. term.setCursorPos(1,1)
  62. print("Inserisci la password: ")
  63. input = read("*")
  64.  
  65. if input == "2222" then
  66. term.setBackgroundColor(colors.green)
  67. term.clear()
  68. term.setCursorPos(1,1)
  69. print("Password corretta")
  70.  
  71. rs.setBundledOutput(lato, colors.gray)
  72. os.sleep(11)
  73. rs.setBundledOutput(lato, 0)
  74. os.reboot()
  75. else
  76. term.setBackgroundColor(colors.red)
  77. term.clear()
  78. term.setCursorPos(1,1)
  79. print("Password errata")
  80. print("")
  81. print("")
  82. os.sleep(3)
  83. os.reboot()
  84. end
  85. elseif y == 16 then
  86. term.setBackgroundColor(colors.black)
  87. term.clear()
  88. term.setCursorPos(1,1)
  89. print("Inserisci la password: ")
  90. input = read("*")
  91.  
  92. if input == "2222" then
  93. term.setBackgroundColor(colors.green)
  94. term.clear()
  95. term.setCursorPos(1,1)
  96. print("Password corretta")
  97. rs.setBundledOutput(lato, colors.black)
  98. os.sleep(11)
  99. rs.setBundledOutput(lato, 0)
  100. os.reboot()
  101. else
  102. term.setBackgroundColor(colors.red)
  103. term.clear()
  104. term.setCursorPos(1,1)
  105. print("Password errata")
  106. os.sleep(3)
  107. os.reboot()
  108. end
  109. end
  110. end
  111. end
  112.  
  113. -- sgamato - alex3025
  114.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement