MrDionesalvi

Elevator Torri

Dec 5th, 2020 (edited)
664
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.clear()
  60.       term.setCursorPos(1,1)
  61.       print("Inserisci la password: ")
  62.       input = read("*")
  63.      
  64.       if input == "2222" then
  65.         term.setBackgroundColor(colors.green)
  66.         term.clear()
  67.         term.setCursorPos(1,1)
  68.         print("Passowrd errata")
  69.  
  70.          rs.setBundledOutput(lato, colors.gray)
  71.         os.sleep(11)
  72.         rs.setBundledOutput(lato, 0)
  73.         os.reboot()
  74.       else
  75.         term.setBackgroundColor(colors.red)
  76.         term.clear()
  77.         term.setCursorPos(1,1)
  78.         print("Passowrd errata")
  79.         print("")
  80.         print("Ta pigli n'der culo amico mio")
  81.         os.sleep(3)
  82.         os.reboot()
  83.       end
  84.     elseif y == 16 then
  85.       term.clear()
  86.       term.setCursorPos(1,1)
  87.       print("Inserisci la password: ")
  88.       input = read("*")
  89.      
  90.       if input == "2222" then
  91.         term.setBackgroundColor(colors.green)
  92.         term.clear()
  93.         term.setCursorPos(1,1)
  94.         print("Passowrd errata")
  95.          rs.setBundledOutput(lato, colors.gray)
  96.         os.sleep(11)
  97.         rs.setBundledOutput(lato, 0)
  98.         os.reboot()
  99.       else
  100.         term.setBackgroundColor(colors.red)
  101.         term.clear()
  102.         term.setCursorPos(1,1)
  103.         print("Passowrd errata")
  104.         print("")
  105.         print("Ta pigli n'der culo amico mio")
  106.         os.sleep(3)
  107.         os.reboot()
  108.       end
  109.     end
  110.   end
  111. end
RAW Paste Data