Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- modem="right"
- rednet.open(modem)
- serverid=0
- comps={}
- while true do
- id,message=rednet.receive()
- print("Recieved message:"..message.." :from "..id)
- if id ~= serverid then
- found=false
- for i=1,#comps do
- if id==comps[i] then
- found=true
- end
- end
- if found==true then
- rednet.send(serverid,message)
- else
- table.insert(comps,id)
- rednet.send(serverid,message)
- end
- else
- for i=1,#comps do
- rednet.send(comps[i],message)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement