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

Farming Turtles

Started by Luanub, 27 February 2012 - 06:28 AM
Luanub #1
Posted 27 February 2012 - 07:28 AM
So far I've had no luck with getting a Turtle to plant wheat seeds. Is this something that is doable? If not is it something that is planned for future releases? If not it should be. ;)/>/>
WireDemon #2
Posted 27 February 2012 - 07:57 AM
Turtles can only place blocks. Which I assume it calculates based on the item's id number.
wilcomega #3
Posted 27 February 2012 - 12:45 PM
they can also break blocks
cokacola #4
Posted 27 February 2012 - 12:59 PM
It actually is possible to plant things.
Check out my code for planting rows of sapplings:
args = { ... }
i=0
i2=0
tt=0

if #args ~= 2 then
print( "Usage: tree <saplings> <rowsize>" )
return
end

while(i < tonumber(args[1])) do
if(i2>tonumber(args[2])) then
if(tt == 0) then
turtle.turnRight()
while(turtle.detect()) do
turtle.up()
end
turtle.forward()
while(turtle.detect()) do
turtle.up()
end
turtle.forward()
while(turtle.detect()) do
turtle.up()
end
turtle.turnRight()
while(turtle.detect()) do
turtle.up()
end
turtle.forward()
tt = 1
else
turtle.turnLeft()
while(turtle.detect()) do
turtle.up()
end
turtle.forward()
while(turtle.detect()) do
turtle.up()
end
turtle.forward()
while(turtle.detect()) do
turtle.up()
end
turtle.turnLeft()
while(turtle.detect()) do
turtle.up()
end
turtle.forward()
tt = 0
end
i2=0

end
for i1=1,10 do
if(turtle.getItemCount(i1) > 0) then
turtle.select(i1)
break
end
end

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

turtle.placeDown()

while(turtle.detect()) do
turtle.up()
end

turtle.forward()
while(turtle.detect()) do
turtle.up()
end
turtle.forward()
while(turtle.detect()) do
turtle.up()
end
turtle.forward()

while(not turtle.detectDown()) do
turtle.down()
end

i=i+1
i2=i2+1
end
I know it could be a lot smaller but I couldn't be bothered.
I have seen the bot plant wheat and such too, so it should be able to fine, just make sure you are one block above the ground when planting.
6677 #5
Posted 27 February 2012 - 01:03 PM
they can also break blocks
This is something we all knew and weren't referring to.
When we mean can only place block we mean that as in cannot place some obscure items and use items such as bonemeal etc.
cokacola #6
Posted 27 February 2012 - 01:44 PM
so seeds don't work the same as saplings I guess.
I don't think it is possible to get it to do anything involving items and right-clicking.

There is a block in redpower that places items on right click, you could place a bunch and have the turtle go and power them.
You could also place them but it wouldn't be incredibly easy to get the seeds into the machine.
Sebra #7
Posted 27 February 2012 - 02:16 PM
you can easily place transposer to drop items into deployer if you do not want to use RP tubes to provide seeds.
But how can turtle get seeds itself? By sitting on RP tube? Will it connect?
Liraal #8
Posted 27 February 2012 - 02:25 PM
i think it should. disk drives do, anyway, but they don't trigger events when transferring floppies.
Sebra #9
Posted 27 February 2012 - 02:44 PM
I think I've seen events…
Turtle inventory can be "special"
Luanub #10
Posted 27 February 2012 - 09:35 PM
Turtles can only place blocks. Which I assume it calculates based on the item's id number.

This is why the seeds wont work, their item id is clasified as an Item and not a block.

Hopefully in the future they wont be limited by a block id classification, seems odd to be able to plant a tree and not seeds.

For now I guess I'll have to find an alternative to fully automate my farm.
6677 #11
Posted 28 February 2012 - 02:44 PM
so seeds don't work the same as saplings I guess.
They most certainly do. You have to be 1 block ABOVE the farmland, ie you don't hover the turtle on the farmland and placeDown onto it, you hover with a 1 block gap and place down.
Seeds are technically a block.
Luanub #12
Posted 28 February 2012 - 09:37 PM
so seeds don't work the same as saplings I guess.
They most certainly do. You have to be 1 block ABOVE the farmland, ie you don't hover the turtle on the farmland and placeDown onto it, you hover with a 1 block gap and place down.
Seeds are technically a block.

Do you have any working code for this?

I'm trying it manually in the lua shell and it will not place a seed being 1 block above the farmland and doing turtle.placeDown()

I've also tried this, doesn't work either. turtle.placeDown() always reports false.

Spoiler

function plant()
print ()
print ("Planting Seeds...")
turtle.up()
turtle.select( 1 )
for x = 1, 8 do
turtle.forward()
turtle.placeDown()
end
for x = 1, 8 do
turtle.back()
end
turtle.down()
main()
end
Edited on 28 February 2012 - 08:48 PM
6677 #13
Posted 29 February 2012 - 11:48 AM
so seeds don't work the same as saplings I guess.
They most certainly do. You have to be 1 block ABOVE the farmland, ie you don't hover the turtle on the farmland and placeDown onto it, you hover with a 1 block gap and place down.
Seeds are technically a block.

Do you have any working code for this?

I'm trying it manually in the lua shell and it will not place a seed being 1 block above the farmland and doing turtle.placeDown()

I've also tried this, doesn't work either. turtle.placeDown() always reports false.

Spoiler

function plant()
print ()
print ("Planting Seeds...")
turtle.up()
turtle.select( 1 )
for x = 1, 8 do
turtle.forward()
turtle.placeDown()
end
for x = 1, 8 do
turtle.back()
end
turtle.down()
main()
end
This is exactly what I did. It worked fine for me with a mining turtle.
Luanub #14
Posted 29 February 2012 - 01:26 PM
Yea I don't think it works… Anyone else have any luck? The below video will show that the code works, but the seeds do not.

Spoiler[media]http://www.youtube.com/watch?v=cYDSjYRMQ4s[/media]
FuzzyPurp #15
Posted 01 March 2012 - 05:23 AM
so seeds don't work the same as saplings I guess.
I don't think it is possible to get it to do anything involving items and right-clicking.

There is a block in redpower that places items on right click, you could place a bunch and have the turtle go and power them.
You could also place them but it wouldn't be incredibly easy to get the seeds into the machine.

You the deployer in rp2 creates a fake player(lol) to do those things
Sebra #16
Posted 01 March 2012 - 02:40 PM
You the deployer in rp2 creates a fake player(lol) to do those things
Thanks Eloraam <3 I want such ability to turtles.
DarkEspeon #17
Posted 21 January 2013 - 10:06 AM
@luanub: it would help if the ground was tilled in the video… lol
Luanub #18
Posted 21 January 2013 - 11:45 AM
@luanub: it would help if the ground was tilled in the video… lol

The dirt was tilled look closer. Also at the time this was posted turtles could neither til the ground nor plant seeds. Why reply to such an old post?
Lyqyd #19
Posted 21 January 2013 - 12:53 PM
Locked.