Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Transmitter Script
- -- Define rednet side and redstone input side
- local modemSide = "left" -- Change to the side where your modem is
- local redstoneInputSide = "right" -- Change to the side where redstone input is detected
- local receiverID = "UUID" -- Unique string ID for the receiver
- rednet.open(modemSide)
- local function updateSignal()
- local signalStrength = redstone.getAnalogInput(redstoneInputSide)
- if signalStrength < 14 then
- rednet.broadcast("deactivate_output", receiverID)
- elseif signalStrength <= 14 then
- rednet.broadcast("activate_output", receiverID)
- end
- end
- -- Initial signal check
- updateSignal()
- while true do
- os.pullEvent("redstone") -- Wait for redstone state change
- updateSignal()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement