Posted 22 January 2013 - 10:39 AM
Got a small train station set up under my house. One computer hooked up to a detector rail (ID13) and a wireless Turtle (ID12) at the end of the Boarding Track(Railcraft). The Turtle works fine, pulling the items from the chest cart and taking them into the house when it gets a message from the wireless computer. Problem is, I keep running into an odd error with the computer.
About seven or eight seconds after running the program on the computer, it comes up with this error: trainHomeServer:7: Too long without yielding. I've been making a few different programs with CC now, though this is my first attempt at a train station, but I've never gotten this error before. I've searched a bit online and have only found things saying that the infinite loop hasn't 'yielded.' or something. Can someone explain what it means by yielding, and help me edit the code to fix the issue?
About seven or eight seconds after running the program on the computer, it comes up with this error: trainHomeServer:7: Too long without yielding. I've been making a few different programs with CC now, though this is my first attempt at a train station, but I've never gotten this error before. I've searched a bit online and have only found things saying that the infinite loop hasn't 'yielded.' or something. Can someone explain what it means by yielding, and help me edit the code to fix the issue?
shell.run("id")
local trainIn = false
rednet.open("left")
while true do
if rs.getOutput("right", true) then
if trainIn == false then
sleep(1)
rednet.send(12, "ARRIVAL")
print("ARRIVED")
trainIn = true
sleep(2)
end
if trainIn == true then
trainIn = false
print("DEPARTED")
sleep(2)
end
end
end