This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
jakemg's profile picture

Too Long without yielding....

Started by jakemg, 05 June 2013 - 09:13 PM
jakemg #1
Posted 05 June 2013 - 11:13 PM
I am trying to run a huge turtle quarry project that i coded with a very complicated gps ocating system but my turtles keeping getting the error turtle:18: Too long with out yielding which is wierd because program is called quarry not turtle. And also other times when i get this error(I use multiple turtles) i get bios:188:Too long without yielding. And not all my turtle are getting this error and when they do its not always at the same time which is telling me its not my code but a computercraft bug. Also I have done some research and found that adding sleep(0) helps this so I tried that with only a few sleep(0)'s that didnt work so now i tried riddling my whole program with sleep(0) and still nothing…and advise would help
valithor #2
Posted 05 June 2013 - 11:31 PM
that problem if i remember correctly is from the lack of sleep commands. It will do this error so the script will not go on forever. After about 100 loops if i remember correctly you will get this error on the line that has happened 100 times. In order to fix i believe you must add a sleep command but the sleep command must contain a amount of time you could do sleep(0.01) which will make it sleep for 1 hundredth of a second and then continue so almost no noticeable pause. This should fix your problem.


sorry i was going off of something i had read over a week ago
Lyqyd #3
Posted 06 June 2013 - 12:53 AM
The above post contains misleading or incorrect information.

Please post your entire code.
YardKing42 #4
Posted 02 July 2013 - 09:54 PM
I had a similar problem with a logging program. I fixed it by changing to a 'for' loop but it might also have been possible to break the 'while' into two so that the program moved on after ~50 cycles. It starts to get messy but if it works…