Posted 07 July 2012 - 04:56 PM
I have a system setup where at floors one computer sends to a main computer which controls what floor an elevator sends you to. But I have the problem that the main program for the control doesn't stop when if receives a message.
I gets the message, then runs the program for the specific floor. If it gets anything other then a floor number is restarts. A computer sends a floor number to the computer, and it does nothing. I only works sometimes if you terminate the program, because then it decides to run FirstFloor or SecondFloor. So it seems like this program is not ending, but is queuing up the other program to run when it is terminated.
x,y,z = rednet.receive()
if y == "1" then
shell.run("FirstFloor")
else
shell.run("ElevatorControl")
end
if y == "2" then
shell.run("SecondFloor")
else
shell.run("ElevatorControl")
end
I gets the message, then runs the program for the specific floor. If it gets anything other then a floor number is restarts. A computer sends a floor number to the computer, and it does nothing. I only works sometimes if you terminate the program, because then it decides to run FirstFloor or SecondFloor. So it seems like this program is not ending, but is queuing up the other program to run when it is terminated.