Advertisement
Guest User

startup

a guest
Feb 16th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. local variety = 1
  2. local errorcount = 0
  3. while 1 do
  4.     for spaceNo = 1,variety do
  5.         if turtle.getItemCount(spaceNo) >= 2 then
  6.             while 1 do
  7.                 local status, data = turtle.inspect()
  8.                 if status == true then
  9.                     if data.metadata == 7 then
  10.                         print("7/7 Harvesting time!")
  11.                         turtle.dig()
  12.                         print ("Crop Harvested, planting number", spaceNo)
  13.                         turtle.select(spaceNo)
  14.                         turtle.place()
  15.                         errorcount = 0
  16.                         turtle.select(variety + 1)
  17.                         turtle.dropDown()
  18.                         turtle.select(spaceNo)
  19.                         break
  20.                     else
  21.                         print("Not fully grown, Growth: ", data.metadata, "/7")
  22.                     end
  23.                 else
  24.                     errorcount = errorcount + 1
  25.                     if errorcount < variety then
  26.                         print("Bugfix")
  27.                         turtle.dig()
  28.                         turtle.select(spaceNo)
  29.                         turtle.place()
  30.                     end
  31.                 end
  32.             end
  33.         else
  34.             print("Not enough seeds, trying another slot")
  35.         end
  36.     end
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement