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

[CC 1.76, MC 1.8] Crafting turtle destroying items when crafted item is already in the inventory

Started by PleaseDeleteMe, 10 January 2016 - 11:47 AM
PleaseDeleteMe #1
Posted 10 January 2016 - 12:47 PM
I'm currently creating a turtle that can craft bread for me from my wheat farm but when it's already got bread in it's inventory (outside of the 3x3 grid) and it crafts the new bread it just destroys the wheat and grabs the bread from the inventory in slot 4, it just destroyed 33 wheat to create 11 bread but I'm still at 53 bread in total even though this should now be 64

The script for this is quite simple

local count = turtle.getItemCount(4)

if count < 64 then
	for i = 1, 3, 1 do
		turtle.select(i)
		turtle.suck(64 - count)
	end
	turtle.select(1)
	turtle.craft()
	turtle.transferTo(4)
end

When I start off with 53 bread in slot for it destroys 33 wheat to 'craft' 11 bread but I end up with still 53 bread in total.

The wiki says "Will not craft if there are any items in the turtle's inventory that are not part of the recipe, including in the slots not used for crafting" and bread should technically not be part of the recipe but just the result. The turtle should not be able to craft the bread if it's already present in the inventory or just add to the stack.

I've already got my code working working by placing a chest below the turtle and using that as a buffer but I do believe that this is still a bug in CC that needs to be addressed.
dan200 #2
Posted 19 January 2016 - 12:43 PM
This has been solved for 1.79