jaklsfjlsak

盾开关信号发射

Apr 24th, 2025
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Script A: On redstone change, broadcast ACTIVATE/DEACTIVATE
  2.  
  3. -- 1) Open your wireless modem on the top side
  4. rednet.open("top")                            -- Open Rednet on "top" :contentReference[oaicite:2]{index=2}
  5.  
  6. -- 2) Loop, waiting for any redstone input change
  7. while true do
  8.   os.pullEvent("redstone")                    -- Wait for redstone event :contentReference[oaicite:3]{index=3}
  9.  
  10.   -- 3) Read the back-side redstone input
  11.   if redstone.getInput("front") then           -- Get back-side input (boolean) :contentReference[oaicite:4]{index=4}
  12.     rednet.broadcast("StatON", "SMiner")     -- Broadcast activation on protocol "pulse" :contentReference[oaicite:5]{index=5}
  13.   else
  14.     rednet.broadcast("StatOFF", "SMiner")   -- Broadcast deactivation on protocol "pulse" :contentReference[oaicite:6]{index=6}
  15.   end
  16. end
  17.  
Advertisement
Add Comment
Please, Sign In to add comment