Do you have a clean rednet environment? Is there any chance that other rednet sources are being received by the second computer? Because it doesn't loop until it gets the right message, if it gets one and only one rednet message and if it's the wrong message then that's it, program over.
You can test this by revising it as so:
rednet.open("right")
id, msg = rednet.receive()
if id == 49 and msg == "start" then
print("received")
rs.setOutput("back", true)
sleep(.25)
rs.setOutput("back", false)
else print("invalid message: "..msg)
end
If you want to loop it to keep checking messages until it gets the right one, you could use:
rednet.open("right")
id, msg = rednet.receive()
while id ~= 49 or msg ~= "start" do
print("invalid message: "..msg)
id, msg = rednet.receive()
end
print("received")
rs.setOutput("back", true)
sleep(.25)
rs.setOutput("back", false)
Code fixes
Edited by ChunLing, 03 December 2012 - 09:54 AM.