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

Program stops runnning

Started by serbaut, 25 April 2014 - 06:23 AM
serbaut #1
Posted 25 April 2014 - 08:23 AM
I have a program feeding 20 MFR BioReactors that randomly stops running after a while. The program is not terminated, I have to terminate it with Ctrl-T.

It often (always?) seems to hang in a call to a peripheral.wrapped call to the BioReactor:

local stacks = br.getAllStacks()

I have tried different chunk loaders, closing off the area from Wrath Lamps but nothing helps. It stops even if there are players online.

Direwolf20 1.0.19 (ComputerCraft 1.57).
serbaut #2
Posted 25 April 2014 - 06:46 PM
Adding os.sleep(0.1) after the turtle has moved in position (just before the getAllStacks() call) seems to resolve the problem.
CCJJSax #3
Posted 25 April 2014 - 07:43 PM
Adding code will help us figure out more precisely what is going on with your code.
serbaut #4
Posted 25 April 2014 - 09:02 PM
https://gist.github....erbaut/11301320

It stopped at line 67 until I added the sleep at line 109

It has been running for a couple of hours now without any issues. Previously it stopped after a random time, up to an hour maybe.

If you want to try to reproduce the problem you need a set up like http://i.imgur.com/8QbdDwB.jpg


X X X X X
X X X X X
X X X X X
X X X X X
X X X X X
%

X = BioReactor
% = turtle on top of me interface facing north

You probably need at least 9 valid fuels in the ae system too.
Edited on 25 April 2014 - 08:09 PM
Bomb Bloke #5
Posted 26 April 2014 - 12:56 AM
I suspect there are some bugs related to peripherals in that build. Or perhaps in whatever mod is offering the peripheral functions for the reactor. Or perhaps both.

I found that I had a similar issue with Factorization barrels (using the same build). If I had the turtle move in front of one, wrap it and then start calling functions: I frequently got an error telling me that the "computer" was "not next to the peripheral" or somesuch. Sleeping for any amount of time before using the peripheral's functions dealt with that, and I suspect that's your only real option here.