I'm a newbie, not only to ComputerCraft, but also to coding in general, so my work posted below will probably be of a very poor standard. But I am interested to learn, so any assistance you could give me would be greatly appreciated, thank you. I've done a lot of research on the wiki, on tutorial videos on Youtube, and reading through code snippets on this forum, and I've already learned a great deal. However I would ask that you try and make replies to this thread nice and simple, so I can understand them better, and if possible explain the logic behind them so that I can comprehend just how and why the code is working as it does.
Here is a link to the text file of my code, since it's getting quite long now: https://www.dropbox....3c44p/quar?dl=1
The problem I'm having is strange. It occurs when the turtle has finished digging down to bedrock and is on it's way back up to the surface. Most of the time it climbs all the way up and deposits anything it has dug out in the chest as it should.
However just occasionally, for no apparent reason, it stops moving some way down, and ejects all it's valuables there instead.
There's no reason for it to stop - it isn't blocked from moving, and it throws no errors to suggest what might be going wrong. I tried adding the chkstart() function to it in an attemt to prevent it happening, but this didn't solve the issue - in fact if anything it seemed to make it happen more regularly. When it ejects the valuables the debug code (all the print("") lines) shows that it is cycling through the inventory purge and status update code as it should, so that code is operating effectivley. It's just that for some reason, it triggers that code while burried way below the surface, instead of next to the collection chest as it should. And it only has this problem occasionally, with no apparent trigger to cause it - many times it functions just as it should.
I'm really confused by it. I don't suppose anyone might be able to assist? Thanks in advance if you can.