60 posts
Location
UK
Posted 10 November 2012 - 07:11 AM
Is it possible to send a table across rednet, I did a little testing but to no avail. If not, is there another efficient way of sending lots of data over rednet (At the moment I'm thinking of joining strings with a semi-colon and separating on the other computer)
521 posts
Location
Stockholm, Sweden
Posted 10 November 2012 - 07:31 AM
Lookup
textutils.serialize() and
textutils.unserialize()!
But basically this is how it works:
--(( Sender ))--
local sendingTable = {
-- Just some random variables
password = 1234,
myName = "kylergs",
binary = 01001011
}
rednet.send(123, text.serialize(sendingTable))
--(( Receiver ))--
local id,msg = rednet.receive()
local receivedTable = textutils.unserialize(msg)
print(receivedTable.password)
-- Will print 1234
60 posts
Location
UK
Posted 18 November 2012 - 08:38 AM
Thanks, that helps a lot.