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

Title: Trouble getting turtle to drop items into a chest.

Started by Whim, 23 May 2014 - 10:30 AM
Whim #1
Posted 23 May 2014 - 12:30 PM
I am very very new to CC and still learning the basics, mostly through tutorials on youtube and on forums and wiki's. I followed different tutorials and put some of the bits that i wanted to implement into a simple program to branch mine a 1 wide and 3 tall area. The program seemed to work quite well until I saved it into a floppy and copied it to other turtles, after that it wouldn't deposit any of the items it collected in any of the turtles i tried it on.

Im not quite sure if i need to explain it because its probably really easy for you guys but ill explain what i tried to do. First i set the length that i wanted (3 in this case, just for testing why it wouldn't deposit) then i told the turtle to check if it had stuff in its inventory (before it starts the actual mining) starting from slot 2 to slot 16 (because slot 1 has an enderchest) and if it does it mines out a block in front of it and sets down the chest and is supposed to drop all the items. The turtle does select all of the slots in order but doesn't actually drop any of the items into the chest. Then it selects the first slot and picks up the chest and goes on detecting and mining above, below, and in front of itself. Then when it is finished it should drop all of the items into the chest doing the same process as before.

Im sorry about the rambling but the stickied threads said to be as thorough as possible. Any help is appreciated and please don't make fun of me in case I derped! :)/>

http://pastebin.com/0zvbSAuz


length=3

if turtle.getItemCount(2) ~=0 then
  turtle.dig()
  turtle.select(1)
  turtle.place()
  for k=2,16 do
	turtle.select(k)
	turtle.drop()
   end
   turtle.select(1)
   turtle.dig()
end

for i=1,length,1 do

while turtle.detect() do
  turtle.dig()
  sleep(1)
end

while turtle.detectUp() do
  turtle.digUp()
  sleep(1)
end

if turtle.detectDown() then
  turtle.digDown()
end

turtle.forward()
end

if turtle.getItemCount(2) ~=0 then
  turtle.dig()
  turtle.select(1)
  turtle.place()
  for l=2,16 do
	turtle.select(l)
	turtle.drop()
	end
turtle.select(1)
turtle.dig()
end
Minion #2
Posted 23 May 2014 - 11:26 PM
I mean, is your enderchest full?
Whim #3
Posted 24 May 2014 - 03:25 AM
Nope, it is hooked up to an extractor module from logistics pipe into a sorting system.

It's really weird cuz it worked fine then just broke for some reason..

But thanks for the reply!!
CCJJSax #4
Posted 25 May 2014 - 02:50 AM
Looking through your code, I can't see why it wouldn't drop items into the chest. that's weird
Inksaver #5
Posted 25 May 2014 - 07:28 PM
I tried your script on a pre-fuelled turtle with both a normal chest and an enderchest.
The normal chest filled ok, but the enderchest refused to take the items. Also when tryng to recover it , I just got 8 obsidian as it broke

This is using cc 1.6.3

I suspect this may be a bug in this version of CC
CCJJSax #6
Posted 26 May 2014 - 06:25 AM
I tried your script on a pre-fuelled turtle with both a normal chest and an enderchest.
The normal chest filled ok, but the enderchest refused to take the items. Also when tryng to recover it , I just got 8 obsidian as it broke

This is using cc 1.6.3

I suspect this may be a bug in this version of CC

I'm pretty sure he is talking about chicken bones' ender chest mod.
AceScottie #7
Posted 26 May 2014 - 07:04 AM
Im really new to CC but when i did something like this i had same issue. so i switched it to turtle.dropUp() instead.and it seemed to fix it. maybe worth a shot
CCJJSax #8
Posted 27 May 2014 - 09:53 PM
Im really new to CC but when i did something like this i had same issue. so i switched it to turtle.dropUp() instead.and it seemed to fix it. maybe worth a shot
That's true, perhaps Chicken Bone's ender chests don't accept from the top. They do have the wool color coding on the top and he could have wanted that accessible. I say try this suggestion.