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

Crafty Turtle doesn't know it's crafty

Started by Phemto, 21 September 2015 - 09:36 AM
Phemto #1
Posted 21 September 2015 - 11:36 AM
I've made a crafty digging turtle, but I'm getting some odd behavior. Here's an example

Place a stack of wood blocks into the turtle's otherwise empty inventory
From the interpreter, execute

lua> turtle.craft()

lua:1: attempt to call nil

It's acting as though the function isn't available. I've tried crafting several things. Yes, I'm getting the configuration of the resources right, and the inventory is otherwise empty.

What is particularly confusing to me is that sometimes it works, but most of the time it doesn't. I haven't found the pattern though.

I'm totally stumped.

Thanks
Lyqyd #2
Posted 21 September 2015 - 04:36 PM
Moved to Ask a Pro.
Lupus590 #3
Posted 21 September 2015 - 07:20 PM
turtle.craft() takes a number as an argument (the amount of times to craft) and outputs to the selected slot (or the next free one)

does that help?
Edited on 21 September 2015 - 05:20 PM
H4X0RZ #4
Posted 21 September 2015 - 09:44 PM
turtle.craft() takes a number as an argument (the amount of times to craft) and outputs to the selected slot (or the next free one)

does that help?

It errors with "attempt to call nil" so the function itself doesn't exist.
Lupus590 #5
Posted 21 September 2015 - 10:52 PM

does the turtle have a (vanilla) crafting table equipped?
Bomb Bloke #6
Posted 21 September 2015 - 11:48 PM
I suppose it wouldn't be a Crafty Digging Turtle if it did not, but it'd be well worth checking the turtle's side to be sure.

It'd be handy to know what triggers the problem, and what makes it start working again.

What build of ComputerCraft are we talking about?

Does rebooting the turtle make a difference?

Does restarting the game make a difference?

Does moving the turtle / placing blocks next to the turtle make a difference?

Does unequipping / re-equipping the bench (with either turtle.equipLeft() or turtle.equipRight()) make a difference?
Edited on 21 September 2015 - 09:48 PM