Code:
--Very repetitive way to find out if there are any items in the inventory
local inv = turtle.getItemCount(1)+turtle.getItemCount(2)+turtle.getItemCount(3)+turtle.getItemCount(4)+turtle.getItemCount(5)+turtle.getItemCount(6)+turtle.getItemCount(7)+turtle.getItemCount(8)+turtle.getItemCount(9)+turtle.getItemCount(10)+turtle.getItemCount(11)+turtle.getItemCount(12)+turtle.getItemCount(13)+turtle.getItemCount(14)+turtle.getItemCount(15)+turtle.getItemCount(16)
local function forward(forw)
curr = 0
for i = 1,forw do
while curr ~= forw do
if not turtle.forward() then
turtle.dig()
turtle.attack()
turtle.forward()
end
curr = curr+1
end
end
end
local function empty() --Dropoff starts here
turtle.select(16)
turtle.placeUp()
turtle.select(1)
select = 1
for i = 1,16 do
turtle.dropUp()
turtle.select(select)
select = select+1
end
sleep(5)
if inv == 0 then
print("Inventory is empty!")
print(inv)
turtle.select(1)
turtle.digUp()
turtle.transferTo(16)
else
print("Inventory didn't empty!")
print(inv)
sleep(5)
empty()
end
end --Ends here
print(inv)
empty()
By the way, if anyone knows a better way to find out how many items are in it's inventory please tell me! I am almost certain that their is a better way. Also, there is some extra stuff besides the dropoff function for the quarry.
Help is appreciated!
Thanks!
P.S. Sorry, if this is hard to follow. I typed it at like 4 in the morning.











