Advertisement
VladTubaka

7x7_ComputerCraft_Wheat_Farm

Apr 17th, 2014
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. --[[
  2. Detects if counter variable is even or odd and determines the Turtle's turn direction
  3. --]]
  4. local function turn(a)
  5. if a%2==0 then
  6. turtle.turnLeft()
  7. turtle.forward()
  8. turtle.turnLeft()
  9. else
  10. turtle.turnRight()
  11. turtle.forward()
  12. turtle.turnRight()
  13. end
  14. end
  15.  
  16. --Initialize the counter variable
  17. x=1
  18. --Make sure the Turtle has selected the slot with the seeds
  19. turtle.select(1)
  20. --The turtle harvests and replants the 7x7 field
  21. for i=1,7 do
  22. turtle.forward()
  23. for i=1,7 do
  24. turtle.digDown()
  25. turtle.placeDown()
  26. turtle.forward()
  27. end
  28. turn(x)
  29. x=x+1
  30. end
  31. --[[
  32. The Turtle returns along the outside of the field and deposits its harvest into a chest
  33. --]]
  34. for i=1,9 do
  35. turtle.forward()
  36. end
  37. turtle.turnRight()
  38. for i=1,7 do
  39. turtle.forward()
  40. end
  41. turtle.turnRight()
  42. for i=2,16 do
  43. turtle.select(i)
  44. turtle.dropDown()
  45. end
  46. turtle.select(1)
  47. --The Turtle returns to its starting point
  48. turtle.forward()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement