Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- slaveName = "5"
- masterID = 0
- outputBool = false
- function testMessage()
- id, message = rednet.receive()
- if id == masterID then
- if message == "t" then
- outputBool = not outputBool
- setRedstone(outputBool)
- end
- end
- end
- function setRedstone(state)
- print("Setting Redstone to: " .. tostring(state))
- redstone.setOutput("back", state)
- end
- setRedstone(outputBool)
- rednet.open("top")
- while true do
- id, message = rednet.receive()
- if message == "KKRNBTNMaster" then
- rednet.send(id, slaveName)
- masterID = id
- print("Discovered Master with ID: " .. id)
- break
- end
- end
- while true do
- testMessage()
- end
Advertisement
Add Comment
Please, Sign In to add comment