Posted 24 January 2015 - 04:43 AM
Trying to set up a control network, and everything was working out fine, until this code
gives the error rednet:39: Expected number
when it receives the senders message:
and the code outputs
The msg variable is not output, and I tried printing id before Received, which caused neither of them to print.
function listen()
local id, msg, dst
print("Listening")
while(true) do
id, msg, dst = rednet.receive(10)
print("Received ", msg)
if (msg == "toggle") then
redstone.setOutput("right", true)
sleep(0.6)
redstone.setOutput("right", false)
else
rednet.send(id, "13")
end
end
end
gives the error rednet:39: Expected number
when it receives the senders message:
rednet.send(a[y]["send"], "toggle")
and the code outputs
Listening
Received
The msg variable is not output, and I tried printing id before Received, which caused neither of them to print.