local function SwitchSlotsIfEmpty() if turtle.getItemCount(cs) < 5 then cs = cs + 1 if cs == 4 then cs = 1 end end end
That's the new version of the function (it's for a mining program I have). Basically; I dig everything in a tunnel - and plug it back up with cobblestone (yeah I know it's slow; but it kills lava - and digs everything for me...) - when running 10 turtles at a time; I can cover a 30 block wide path for mining (going hundreds of blocks deep)... 30 minutes of work has netted me as many as 32 diamonds at one point.
So my problem is when I run into a LOT of lava; it clearly goes through cobblestone fast - and I ran into a situation (with my first block of code) that it placed the last block of cobblestone, moved to the next spot and dug up a diamond, then tried to put it back (and because of my coding; it keeps trying to place it - thus, it 'locked up' (infinite loop...)
So, I decided to do the block of code above - as you can see it places 59 blocks of cobblestone, and then switches to slot 2. The problem I see, is if it places 177 cobblestone (without digging any (59 x 3)) it's just gonna loop again...
Any suggestions on how to fix this? My brain is fried and I just can't figure a good solution...











