Posted 19 February 2013 - 06:35 AM
The main body of the code works fine but I have written a function named inventFull() that should stop the program with an error message when the turtle's inventory is full, but for some reason it doesn't. Instead the turtle behaves as it would normally, spitting out the items from the back when the inventory is full. I'm fairly certain that the problem lies within the inventFull() function so for the moment I will only include that code, but I will be happy to provide more of my code if it will help solve the issue.
Here is the code for the inventFull() function:
P.S. I am using the FeedTheBeast modpack which I assume uses the latest version of ComputerCraft, if that makes any difference.
Here is the code for the inventFull() function:
function checkInvent()
for i = 1,16 do
if turtle.getItemCount(i) == 0 then
inventFull = false
break
end
end
if not inventFull == false then
inventFull = true
print("Inventory Full!")
if blocksMoved > 0 then
print("Returning to start...")
returnToStart()
end
error("Could not mine because inventory is full.")
end
end
P.S. I am using the FeedTheBeast modpack which I assume uses the latest version of ComputerCraft, if that makes any difference.