Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Receiver Script
- -- Define rednet side and redstone output side
- local modemSide = "top" -- Change to the side where your modem is
- local redstoneOutputSide = "back" -- Change to the side where redstone output should be set
- local receiverID = "UUID" -- Unique string ID to match transmitter
- rednet.open(modemSide)
- local function handleMessage(senderID, message, protocol)
- if protocol == receiverID then
- if message == "activate_output" then
- redstone.setOutput(redstoneOutputSide, true)
- elseif message == "deactivate_output" then
- redstone.setOutput(redstoneOutputSide, false)
- end
- end
- end
- while true do
- local event, senderID, message, protocol = os.pullEvent("rednet_message")
- handleMessage(senderID, message, protocol)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement