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

Loop Help

Started by freiguy48, 12 April 2012 - 10:47 PM
freiguy48 #1
Posted 13 April 2012 - 12:47 AM
Hey when I create a infinite loop it flashes really fast then after a couple of seconds it says "bios:82: Too long without yielding" then it closes
Is there anyway around this problem?
MysticT #2
Posted 13 April 2012 - 01:01 AM
You have to make the program yield, using os.pullEvent.
If you don't want to wait for an event, you can use sleep with a value of 0, or do something like this:

os.queueEvent("fake")
os.pullEvent()
That should make it work.
freiguy48 #3
Posted 13 April 2012 - 01:28 AM
Thanks that helped