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

Inventory Clear

Started by Trot, 30 December 2012 - 06:10 PM
Trot #1
Posted 30 December 2012 - 07:10 PM
I am trying to get my turtle to drop his inventory after returning from a trip. This is the code for him to drop the stuff:

for i = 1,16 do
	turtle.select(i)
	turtle.drop()
end
  print("dropped")
  turtle.select(1)

It worked fine if I separate it into its own program, but the turtle ignores the turtle.drop() command completely in my code. I don't have anything I know of that could interfere with it. What could interfere with the drop command.
ChunLing #2
Posted 30 December 2012 - 07:27 PM
Huh. Okay, I'm stumped. That looks just like the code I use to dump inventory into a chest, and mine works fine.
Kingdaro #3
Posted 30 December 2012 - 07:34 PM
What's your ComputerCraft version?
Trot #4
Posted 30 December 2012 - 07:44 PM
What's your ComputerCraft version?

1.4
Kingdaro #5
Posted 30 December 2012 - 07:56 PM
Bleh, that's not the problem then. According to the wiki, the function only fails if the inventory in front of it is full. :/
Luanub #6
Posted 30 December 2012 - 08:07 PM
What are you trying to drop it into? Have you tried it directly onto the ground? Its probably a physical setup issue.
remiX #7
Posted 30 December 2012 - 10:02 PM
Have you maybe overwritten the function in your code?
Trot #8
Posted 31 December 2012 - 05:27 AM
What are you trying to drop it into? Have you tried it directly onto the ground? Its probably a physical setup issue.

You were correct, Just figured it out after a night's sleep. The turtle was facing the disk drive and was probably trying to place all the inventory into the slot, but couldn't.