Jump to content




Multiple ID rednet.send()?


  • You cannot reply to this topic
1 reply to this topic

#1 basdxz

  • Members
  • 116 posts

Posted 24 August 2012 - 06:16 AM

Hi I was wondering if it was possible to send a message to multiple computers with one send without using rednet.broadcast()?

#2 Luanub

    Lua Nub

  • Members
  • 1,135 posts
  • LocationPortland OR

Posted 24 August 2012 - 08:38 AM

Yes, put the id's that you want to send the message to in a table the interate through the table with a for loop.

local sendTo = { 1, 2, 3, 4 } -- computer id's 1 - 4

write("enter message: ")
local msg = read()
for var, x in pairs(sendTo) do
rednet.send(x, msg)
end






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users