SHOW:
|
|
- or go back to the newest paste.
| 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("ACTIVATE", "pulse") -- Broadcast activation on protocol "pulse" :contentReference[oaicite:5]{index=5}
|
| 12 | + | rednet.broadcast("StatON", "SMiner") -- Broadcast activation on protocol "pulse" :contentReference[oaicite:5]{index=5}
|
| 13 | else | |
| 14 | - | rednet.broadcast("DEACTIVATE", "pulse") -- Broadcast deactivation on protocol "pulse" :contentReference[oaicite:6]{index=6}
|
| 14 | + | rednet.broadcast("StatOFF", "SMiner") -- Broadcast deactivation on protocol "pulse" :contentReference[oaicite:6]{index=6}
|
| 15 | end | |
| 16 | end | |
| 17 |