Advertisement
N2AZ

receiver

Nov 4th, 2024
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. local speaker = peripheral.find("speaker")
  2. local modem = peripheral.find("modem")
  3.  
  4. if not modem then
  5. error("Aucun modem trouvé")
  6. end
  7.  
  8. modem.open(1) -- Ouvrir le même canal que l'émetteur
  9.  
  10. while true do
  11. local event, side, channel, replyChannel, message, distance = os.pullEvent("modem_message")
  12. if channel == 1 then
  13. -- Jouer le buffer reçu
  14. while not speaker.playAudio(message) do
  15. os.pullEvent("speaker_audio_empty")
  16. end
  17. end
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement