Advertisement
Aixler

cocoa

Nov 4th, 2013
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.92 KB | None | 0 0
  1.  function dig()
  2.     if turtle.getItemCount(15) > 0 then
  3.         turtle.select(1)
  4.         turtle.placeUp()
  5.         slot = 2
  6.         for x=1, 15 do
  7.             turtle.select(slot)
  8.             turtle.dropUp()
  9.             slot = slot + 1
  10.         end
  11.         turtle.select(1)
  12.         turtle.digUp()
  13.         turtle.select(2)
  14.     end
  15.     turtle.dig()
  16. end
  17.  
  18. function place()
  19.     for bean=2, 16 do
  20.         if turtle.getItemCount(bean) > 0 then
  21.             turtle.select(bean)
  22.             turtle.place()
  23.             return
  24.         end
  25.     end
  26. end
  27.  
  28.  function row()
  29.      for x=1, 8 do
  30.         dig()
  31.         place()
  32.         if right == true then
  33.             turtle.turnRight()
  34.             turtle.forward()
  35.             turtle.turnLeft()
  36.         else
  37.             turtle.turnLeft()
  38.             turtle.forward()
  39.             turtle.turnRight()
  40.         end
  41.     end
  42.     dig()
  43.     place()
  44. end
  45.  
  46. function harvest()
  47.     right = true
  48.     row()
  49.     turtle.up()
  50.     right = false
  51.     row()
  52.     turtle.up()
  53.     right = true
  54.     row()
  55.     turtle.up()
  56.     right = false
  57.     row()
  58.     for x=1, 3 do
  59.         turtle.down()
  60.     end
  61. end
  62.  
  63. while true do
  64.     harvest()
  65.     sleep(600)
  66. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement