Advertisement
BigBlow_

Untitled

Nov 1st, 2024
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. -- Ouvrir le modem
  2. rednet.open("back")
  3.  
  4. -- Boucle principale pour écouter les commandes
  5. while true do
  6. local senderID, message = rednet.receive()
  7.  
  8. if message == "ping" then
  9. rednet.send(senderID, "pong") -- Répond au ping pour être détecté
  10.  
  11. elseif message == "on" then
  12. redstone.setOutput("right", true) -- Allume la lampe (modifie "right" selon la configuration)
  13.  
  14. elseif message == "off" then
  15. redstone.setOutput("right", false) -- Éteint la lampe
  16. end
  17. end
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement