Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local speaker = peripheral.find("speaker")
- local modem = peripheral.find("modem")
- if not modem then
- error("Aucun modem trouvé")
- end
- modem.open(1) -- Ouvrir le même canal que l'émetteur
- while true do
- local event, side, channel, replyChannel, message, distance = os.pullEvent("modem_message")
- if channel == 1 then
- -- Jouer le buffer reçu
- while not speaker.playAudio(message) do
- os.pullEvent("speaker_audio_empty")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement