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

turtles + automatic crafting...how? im confused

Started by CreeperGoBoom, 19 June 2014 - 09:55 AM
CreeperGoBoom #1
Posted 19 June 2014 - 11:55 AM
how exactly do i tell the turtle to send particular items to particular slots? since the only things that can be returned are amounts not names? any ideas? i have no clue how this would be done

for exampe to automatically craft something mid difficult like a piston after simply pumping all the required ingredients into the turtle?
Bomb Bloke #2
Posted 19 June 2014 - 12:55 PM
I suppose you could use turtle_inventory events, but I suspect if you're pumping items in fast enough that might not be reliable. CC code runs fast, but it's not instant, and if there are other systems in the world it would be pretty easy to get things confused.

You might find it easier to have the turtle pull the items into it - in this way, it would know exactly what it was getting based on where it pulled from. If you wrap a container using OpenPeripheral, it becomes even easier to manage items (as you can not only see item IDs, but you can manipulate container slots from directions that otherwise wouldn't be possible).

There's a "narcissistic" turtle upgrade available via OpenPeripheral that allows a turtle to examine its own inventory, but frankly I'd recommend keeping it out of your plans. I say this on the basis that any solution that involves items entering the turtle's inventory without its direct say-so is likely to run into "issues", and if the turtle does have control over that, then it shouldn't need to re-examine the identity info of what it's carrying at any point.
CreeperGoBoom #3
Posted 19 June 2014 - 01:29 PM
thanks Bomb Bloke ill look into it :)/>