Posted 18 October 2013 - 12:13 AM
Hey, me again. I've written a couple programs that use Rednet, and one that is supposed to say whether a file existed on another computer is giving me trouble. No matter what the program name I give it, it always returns a blank line instead of the "SUCCESS" or "FAILURE" I want it to. Here are the programs.
Sending End:
Receiving End:
How can I get my code back on the sending end to display the correct success/failure printout?
Sending End:
rednet.open("back")
while true do
print("Execute Instructions")
local input = read()
if input == "Lockdown" then
shell.run("Lockdown")
else
while true do
rednet.broadcast(input)
message = rednet.receive()
print(text)
break
end
end
end
Receiving End:
rednet.open("back")
while true do
event, id, text = os.pullEvent()
if event == "rednet_message" then
if fs.exists(text) then
rednet.broadcast("SUCCESS")
shell.run(text)
else rednet.broadcast("FAILURE")
end
end
end
How can I get my code back on the sending end to display the correct success/failure printout?