Feaders

Central gare

Feb 28th, 2025
12
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. -- CENTRALE (Récepteur)
  2. -- Affiche la dernière station reçue sur un moniteur branché à l'arrière.
  3.  
  4. local modemSide = "left"
  5. local monitorSide = "back"
  6. local monitor = peripheral.wrap(monitorSide)
  7.  
  8. rednet.open(modemSide)
  9. local stations = {"Gare A", "Gare B", "Gare C", "Gare D", "Gare E"}
  10. while true do
  11. local _, station = rednet.receive()
  12. monitor.clear()
  13. monitor.setCursorPos(1, 1)
  14. for i, st in ipairs(stations) do
  15. if st == station then
  16. monitor.setTextColor(colors.green)
  17. monitor.write("["..st.."] ")
  18. else
  19. monitor.setTextColor(colors.white)
  20. monitor.write(st.." ")
  21. end
  22. end
  23. monitor.setTextColor(colors.white)
  24. end
Add Comment
Please, Sign In to add comment