Advertisement
PowerLion30

computer centrale

Aug 7th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.14 KB | None | 0 0
  1. mon = peripheral.wrap("top")
  2. Username = "Christian30"
  3. Password = "4560"
  4. Debug = "giaig"
  5. rednet.open("left")
  6. PcPorta = redstone.getInput("right")
  7. local pos = 1
  8. local pos1 = 1
  9.  
  10. mon.clear()
  11. mon.setTextScale(1)
  12. mon.setTextColor(colors.blue)
  13. mon.clear()
  14. mon.setCursorPos(pos,15)
  15. mon.write("Pannello di controllo")
  16. mon.setTextScale(1)
  17. mon.setTextColor(colors.cyan)
  18. mon.setCursorPos(pos1,4)
  19. mon.write("Porta entrata casa: ")
  20. mon.setTextScale(3)
  21. mon.setTextColor(colors.blue)
  22. mon.setCursorPos(1,6)
  23. mon.write("Computer: AUTENTICARSI")
  24. term.clear()
  25. term.setCursonPos(2.2)
  26. print("Buncker di Christian30, autenticarsi prego")
  27. term.setCursonPos(1,4)
  28. write("Username: ")
  29. user = read()
  30. write("Password: ")
  31. pwd = read("x")
  32.  
  33. Robot = true
  34.  
  35. while Robot do
  36.  
  37.     if Username == user and Password == pwd then
  38.         term.setCursonPos(2,7)
  39.         term.setTextColor(colors.green)
  40.         write("ACCESSO RIUSCITO")
  41.         mon = peripheral.wrap("top")
  42.         mon.clear()
  43.         mon.setTextScale(3)
  44.         mon.setTextColor(colors.green)
  45.         mon.clear()
  46.         mon.setCursorPos(1,6)
  47.         mon.write("Computer: Accesso Riuscito")
  48.         rs.setOutput("right", true)
  49.         os.sleep(4)
  50.         rs.setOutput("right", false)
  51.         os.reboot()
  52.     elseif Username == user and Debug == pwd then
  53.         term.setCursonPos(2,7)
  54.         term.setTextColor(colors.cyan)
  55.         write("MODALITA' DEBUG ATTIVATA")
  56.         mon = peripheral.wrap("top")
  57.         mon.clear()
  58.         mon.setTextScale(3)
  59.         mon.setTextColor(colors.cyan)
  60.         mon.clear()
  61.         mon.setCursorPos(1,6)
  62.         mon.write("Computer: Debug")
  63.         term.clear()
  64.         os.sleep(2)
  65.         term.setCursonPos(1,1)
  66.         Robot = false
  67.     else
  68.         term.setCursonPos(2,7)
  69.         term.setTextColor(colors.red)
  70.         write("Username o Password errati, riprovare prego")
  71.         mon = peripheral.wrap("top")
  72.         mon.clear()
  73.         mon.setTextScale(3)
  74.         mon.setTextColor(colors.red)
  75.         mon.clear()
  76.         mon.setCursorPos(1,6)
  77.         mon.write("Computer: Errore riprovare")
  78.         os.sleep(3)
  79.         os.reboot()
  80.     end
  81. end
  82.  
  83. if PcPorta == true then
  84.     mon.setTextScale(1)
  85.     mon.setTextColor(colors.green)
  86.     mon.setCursorPos(10,4)
  87.     mon.write("ON")
  88. elseif PcPorta == false then
  89.     monsetTextScale(1)
  90.     mon.setTextColor(colors.red)
  91.     mon.setCursorPos(10,4)
  92.     mon.write("OFF")
  93. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement