Hiranus

Receive

Jun 17th, 2019
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.35 KB | None | 0 0
  1. local ReceivedData = {};
  2.  
  3. function ReceiveLoop(recProtocol)
  4.   while true do
  5.     local sender,message,protocol = rednet.receive(recProtocol);
  6.     ReceivedData[#ReceivedData + 1] = {Sender = sender,Message = message, Protocol = protocol};
  7.   end
  8. end
  9.  
  10. function GetReceivedData()
  11.   local tmp = ReceivedData;
  12.   ReceivedData = {};
  13.   return tmp;
  14. end
Advertisement
Add Comment
Please, Sign In to add comment