Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local id = 1
- rednet.open("bottom")
- local bit = peripheral.wrap("top")
- while true do
- local e,i,m = os.pullEvent()
- if e == "rednet_message" then
- local p = {id}
- p.m = m
- bit.transmit(p)
- print("Rednet: "..m)
- elseif e == "bitnet_message" then
- if m[1] then
- local t = false
- for k,v in pairs(m) do
- if v == id then t = true end
- end
- if not t then
- rednet.broadcast(m.m)
- table.insert(m,id)
- bit.transmit(m)
- print("Bitnet: "..m.m)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement