Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Elevator Controller by dionesalvi @ Calafrica Group
- -- Product Key: AJGFGR543
- lato = "left"
- term.clear()
- term.setCursorPos(1, 2)
- term.write("Benvenuto!")
- term.setCursorPos(1, 3)
- term.write("Seleziona un piano:")
- term.setCursorPos(1, 6)
- term.setBackgroundColor(colors.magenta)
- term.write(" * Primo Piano ")
- term.setCursorPos(1, 8)
- term.setBackgroundColor(colors.lightBlue)
- term.write(" * Secondo Piano ")
- term.setCursorPos(1, 10)
- term.setBackgroundColor(colors.yellow)
- term.setTextColor(colors.black)
- term.write(" * Terzo Piano ")
- term.setTextColor(colors.white)
- term.setCursorPos(1, 12)
- term.setBackgroundColor(colors.lime)
- term.write(" * Quarto Piano ")
- term.setCursorPos(1, 14)
- term.setBackgroundColor(colors.pink)
- term.write(" * Quinto Piano ")
- term.setCursorPos(1, 16)
- term.setBackgroundColor(colors.blue)
- term.write(" * Sesto Piano ")
- while true do
- _, button, x, y = os.pullEvent("mouse_click")
- if (x >= 1 and x <= 17) then
- if y == 6 then
- rs.setBundledOutput(lato, colors.red)
- os.sleep(3)
- rs.setBundledOutput(lato, 0)
- elseif y == 8 then
- rs.setBundledOutput(lato, colors.magenta)
- os.sleep(5)
- rs.setBundledOutput(lato, 0)
- elseif y == 10 then
- rs.setBundledOutput(lato, colors.purple)
- os.sleep(7)
- rs.setBundledOutput(lato, 0)
- elseif y == 12 then
- rs.setBundledOutput(lato, colors.white)
- os.sleep(9)
- rs.setBundledOutput(lato, 0)
- elseif y == 14 then
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setCursorPos(1,1)
- print("Inserisci la password: ")
- input = read("*")
- if input == "2222" then
- term.setBackgroundColor(colors.green)
- term.clear()
- term.setCursorPos(1,1)
- print("Password corretta")
- rs.setBundledOutput(lato, colors.gray)
- os.sleep(11)
- rs.setBundledOutput(lato, 0)
- os.reboot()
- else
- term.setBackgroundColor(colors.red)
- term.clear()
- term.setCursorPos(1,1)
- print("Password errata")
- print("")
- print("")
- os.sleep(3)
- os.reboot()
- end
- elseif y == 16 then
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setCursorPos(1,1)
- print("Inserisci la password: ")
- input = read("*")
- if input == "2222" then
- term.setBackgroundColor(colors.green)
- term.clear()
- term.setCursorPos(1,1)
- print("Password corretta")
- rs.setBundledOutput(lato, colors.black)
- os.sleep(11)
- rs.setBundledOutput(lato, 0)
- os.reboot()
- else
- term.setBackgroundColor(colors.red)
- term.clear()
- term.setCursorPos(1,1)
- print("Password errata")
- os.sleep(3)
- os.reboot()
- end
- end
- end
- end
- -- sgamato - alex3025
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement