Advertisement
jaklsfjlsak

sminer信号接收

Apr 23rd, 2025 (edited)
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Script B: Listen for "pulse" broadcasts and drive front-side redstone
  2. local speaker = peripheral.find("warpdriveSpeaker")
  3. -- 1) Open your wireless modem on the top side
  4. rednet.open("top")                            -- Open Rednet on "top" :contentReference[oaicite:7]{index=7}
  5.  
  6. -- 2) Loop, receiving commands and setting the front output
  7. while true do
  8.   local senderID, message = rednet.receive("SMiner")  -- Receive on protocol "pulse" :contentReference[oaicite:8]{index=8}
  9.  
  10.   -- 3) Update front-side redstone based on the message
  11.   if message == "check" then
  12. speaker.speak("Checked")
  13. print("checked")
  14.    
  15.   end
  16. end
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement