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

[1.33] Add crafting to turtles

Started by tatskaari, 15 May 2012 - 04:01 PM
tatskaari #1
Posted 15 May 2012 - 06:01 PM
It would be so cool if I could program my turtles to manage inventories and be able to craft items. To do this the turtles would need a more advanced way of determining what an item then turtle.compare(). They would also need to be able to search chests and use crafting tables or just have a built in crafting table.

The turtles could become like an automated factory in a way that at a main terminal I could request an item and then the turtles will search the chests for the item and if they can't find it then they should go to a crafting table and craft it for me kind of like how logistics pipes work. If they can not find the item then I could also program them to go collect the resources required to produce the item.

If turtles could craft then I could make almost anything using just computercraft and I would not need to install mods like buildcraft.

Yay or nay?
EmTeaKay #2
Posted 15 May 2012 - 06:12 PM
Yay I say! Also, this code could work:
turtle.compare("dirt")
It would then compare only with dirt. Or:
turtle.getItem("chest", "1", "1")
This would gather items in that chest slot.
tatskaari #3
Posted 15 May 2012 - 07:07 PM
Here could be some code for crafting some sticks where top left is slot 1 and bottom right is slot 9. The output slot is slot 10.
– storeItem(possition,count)
turtle.select(1)
turtle.storeItem(1,1)
turtle.storeItem(4,1)
turetle.getItem(10,4)

for this to work the turtle would have to stand in front of a crafting table.

storeItem() could also just store one item in the currently selected slot.

Another way that inventory management could work is with turtle.findItem(itemName) which will return the slot number containing the item. This could also have forward, left and right commands to find items in adjacent inventories.
Xfel #4
Posted 15 May 2012 - 07:41 PM
I don't think dan will add that. As far as I know, he thinks it's overpowered. But if you need programmable crafting, take a look on the Advanced Resource Processing peripheral mod (link in my signature). It contains an programmable crafting table.
tatskaari #5
Posted 16 May 2012 - 05:22 PM
Xfel, thank you, that was very similar to what I need. :P/>/>