Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.wrap("top")
- rednet.open("top")
- local monitorID = 15
- local isOn = false
- function WaitAndRelay()
- while true do
- local sender, message = rednet.receive()
- if string.find(message, "<on>") and isOn == false then
- redstone.setOutput("front", true)
- print("Received On call")
- isOn = true
- elseif string.find(message, "<off>") and isOn == true then
- redstone.setOutput("front", false)
- print("Received Off call")
- isOn = false
- else
- print(message)
- rednet.send(monitorID, message)
- end
- end
- end
- WaitAndRelay()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement