Posted 26 March 2013 - 09:58 AM
I'm trying to send a table over rednet then have a variable changed to one of the table's values.
Here's my code:
Here's my code:
--Sender Code
local rednetoutputs = { up = 0, down = 0, diffselected}
rednet.open("bottom")
--unrelated code
diff = io.read()
if diff == "5" then gDiff = 500
rednetoutputs.diffselected = "5"
rednet.send(26, textutils.serialize(rednetoutputs))
end
--Receiver Code
rednet.open("bottom")
os.pullEvent("rednet_message")
local id1, difftable, dist1 = rednet.receive()
textutils.unserialize(difftable)
diff = rednetoutputs[diffselected]
if diff == "5" then gDiff = 500
I'm working off of Casper's Pong as a code base.