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