Advertisement
Protowalker

CC Farmer

Jun 6th, 2020
1,588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.21 KB | None | 0 0
  1. os.loadAPI("apis/tortoise.lua")
  2.  
  3.  
  4. local plantTypes = {}
  5. plantTypes["minecraft:wheat"] = 7
  6. plantTypes["minecraft:carrots"] = 7
  7. plantTypes["minecraft:beetroots"] = 3
  8.  
  9. local prog = 0
  10. while true do
  11.     while not turtle.detect() do
  12.         local success,data = turtle.inspectDown()
  13.         if turtle.getItemCount(2) == 1 then tortoise.consolidateItems(2) end
  14.         if not success then
  15.             turtle.select(2)
  16.             turtle.placeDown()
  17.         else
  18.             if data.state.age == plantTypes[data.name] then
  19.                 turtle.select(2)
  20.                 tortoise.replaceDown()
  21.             end
  22.             turtle.select(3)
  23.             turtle.placeDown()
  24.         end
  25.             tortoise.moveForward()
  26.     end
  27.     if prog%2==0 then tortoise.turnRight()
  28.     else tortoise.turnLeft() end
  29.     if turtle.detect() then break end
  30.     tortoise.moveForward()
  31.     if prog%2==0 then tortoise.turnRight()
  32.     else tortoise.turnLeft() end
  33.    
  34.     local success,data = turtle.inspectUp()
  35.     if success and data.name == "minecraft:chest" then
  36.         tortoise.consolidateItems(2)
  37.         for i=4,16 do
  38.             turtle.dropUp(turtle.getItemCount(i))
  39.         end
  40.     end
  41.  
  42.     prog = prog + 1
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement