Jump to content




basic turtle function not working as i intended, help!


  • You cannot reply to this topic
5 replies to this topic

#1 Cenarius

  • Members
  • 3 posts

Posted 05 January 2014 - 01:24 AM

Hello guys!
so i was messing around with turtles, i wrote a simple test :

function MoveOn()
turtle.forward()
  if turtle.detect() then
   turtle.turnLeft()
  end
end
function Farm()
MoveOn()
  if turtle.compareDown() then
   turtle.digDown()
  end
end

turtle.select(16)

while true do
Farm()
end

now i put a wheat in slot 16, but it is not farming it :/

i was trying to find out what's wrong so i tried the same with a digging turtle, and i put dirt in slot 16 and some on the turtle's way, it worked, so i'm confused..
help me out please, what am i doing wrong?

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 05 January 2014 - 02:40 PM

Wheat items are not the same as wheat blocks, so compare will return false.

#3 Cenarius

  • Members
  • 3 posts

Posted 05 January 2014 - 04:20 PM

View PostLyqyd, on 05 January 2014 - 02:40 PM, said:

Wheat items are not the same as wheat blocks, so compare will return false.

oh, i see, so how can the turtle to detect blocks that i can't get?
i looked up the wiki and i can't find any other functions to do this :/
are there any mods or ways around this?

#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 05 January 2014 - 06:44 PM

A regular ComputerCraft turtle cannot determine whether wheat has grown. I gather Aperture Science turtles can.

I made a 16x16 space and had my turtle harvest it once an hour. Probably 95% of the wheat has grown by the time it performs each sweep. Given that you can usually expect it to take at least half an hour for wheat to grow, having the turtle constantly roam the plot looking for grown plants would seemingly wind up achieving only a slight increase in production in exchange for a massive wastage of fuel.

#5 Cenarius

  • Members
  • 3 posts

Posted 05 January 2014 - 07:53 PM

View PostBomb Bloke, on 05 January 2014 - 06:44 PM, said:

A regular ComputerCraft turtle cannot determine whether wheat has grown. I gather Aperture Science turtles can.

I made a 16x16 space and had my turtle harvest it once an hour. Probably 95% of the wheat has grown by the time it performs each sweep. Given that you can usually expect it to take at least half an hour for wheat to grow, having the turtle constantly roam the plot looking for grown plants would seemingly wind up achieving only a slight increase in production in exchange for a massive wastage of fuel.

interesting, i hear aperture science is too op, dun want that coz it's kinda pointless if there is no challenge xD
Thanks for the tip though

i don't really care about making a farm i was just messing around with the functionality and got confused..

Thanks again guys

#6 subzero22

  • Members
  • 97 posts

Posted 06 January 2014 - 10:49 AM

you might want to test it on reeds then as I got a turtle that will start farming reeds when the reed it detects is fully grown.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users