Posted 10 August 2017 - 03:55 AM
So basically I have a edited startup on my Advanced Computer. Basically what the code is supposed to do is it is supposed to be waiting for a rednet signal to be received.
rednet.open("back")
while true do
id, message = rednet.receive()
end
if message == "LPA1OpenClosed" then
shell.run("LPA1OpenClosed")
end
if message == "LPA1COpenOpen" then
shell.run("LPA1OpenOpen")
end
if message == "LPA1ClosedClosed" then
shell.run("LPA1ClosedClosed")
end
if message == "LPA1ClosedOpen" then
shell.run("LPA1ClosedClosed")
end
Then I also have a code written on my pocket computer that is supposed to be sending the rednet signal and message.
rednet.open("back"
rednet.send(7, "LPA1OpenClosed")
print("Opening North LP. Closing South LP.")
sleep(3)
term.clear()
term.setCursorPos(1,1)
print("TMC OS V1.0.0")
rednet.close("back")
By the way in the "rednet.send(7, LPA1OpenClosed)", 7 is the ID of the advanced computer.
In the first code that I showed you, when there was only one if statement the message was getting sent and received fine. But now that I added more if statements, nothing is getting received and the Advanced Computer is frozen until I ctrl + T to terminate the startup program.
Also I have made the programs on the Advanced Computer for the shell.run("LPA1OpenClosed") etc.
Any reasons as to why the Advanced Computer isn't receiving a signal and running the program it's supposed to based of the message received?
rednet.open("back")
while true do
id, message = rednet.receive()
end
if message == "LPA1OpenClosed" then
shell.run("LPA1OpenClosed")
end
if message == "LPA1COpenOpen" then
shell.run("LPA1OpenOpen")
end
if message == "LPA1ClosedClosed" then
shell.run("LPA1ClosedClosed")
end
if message == "LPA1ClosedOpen" then
shell.run("LPA1ClosedClosed")
end
Then I also have a code written on my pocket computer that is supposed to be sending the rednet signal and message.
rednet.open("back"
rednet.send(7, "LPA1OpenClosed")
print("Opening North LP. Closing South LP.")
sleep(3)
term.clear()
term.setCursorPos(1,1)
print("TMC OS V1.0.0")
rednet.close("back")
By the way in the "rednet.send(7, LPA1OpenClosed)", 7 is the ID of the advanced computer.
In the first code that I showed you, when there was only one if statement the message was getting sent and received fine. But now that I added more if statements, nothing is getting received and the Advanced Computer is frozen until I ctrl + T to terminate the startup program.
Also I have made the programs on the Advanced Computer for the shell.run("LPA1OpenClosed") etc.
Any reasons as to why the Advanced Computer isn't receiving a signal and running the program it's supposed to based of the message received?