Advertisement
Chronno

Computercraft Turtle Crop Farming

Apr 5th, 2013
918
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 0 0
  1. -- Seeds in slot 1
  2. -- bone meal in slot 2
  3. -- Call the program by the name of the program, space, and the number of items in the smallest stack
  4. -- Works with all crops except corn and cacti.
  5. -- requires Farming Turtle, block of dirt in front of and one block down from the turtle, and a
  6. -- jungle wood log two blocks in front of the turtle for coco beans.
  7.  
  8. local plants = {...}
  9.  
  10. if plants[1] > turtle.getItemCount(2) then
  11.     print("Not enough bone meal in slot 2")
  12.     return
  13. elseif plants[1] > turtle.getItemCount(1) then
  14.     print("not enough seeds in slot 1")
  15.     return
  16. end
  17. for i=1,plants[1] do
  18.     turtle.dig()
  19.     turtle.select(1)
  20.     turtle.place()
  21.     turtle.select(2)
  22.     turtle.place()
  23.     turtle.up()
  24.     turtle.dig()
  25.     turtle.down()
  26.     turtle.dig()
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement