Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- CENTRALE (Récepteur)
- -- Affiche la dernière station reçue sur un moniteur branché à l'arrière.
- local modemSide = "left"
- local monitorSide = "back"
- local monitor = peripheral.wrap(monitorSide)
- rednet.open(modemSide)
- local stations = {"Gare A", "Gare B", "Gare C", "Gare D", "Gare E"}
- while true do
- local _, station = rednet.receive()
- monitor.clear()
- monitor.setCursorPos(1, 1)
- for i, st in ipairs(stations) do
- if st == station then
- monitor.setTextColor(colors.green)
- monitor.write("["..st.."] ")
- else
- monitor.setTextColor(colors.white)
- monitor.write(st.." ")
- end
- end
- monitor.setTextColor(colors.white)
- end
Add Comment
Please, Sign In to add comment