Fatherless

farmerStartup

Dec 9th, 2024 (edited)
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. --[[
  2.  
  3. This program will tell a turtle to farm a single crop type on adjacent plots
  4. The turtle will replant it with whatever seed is in slot 1
  5. The turtle will drop everything else in it's inventory down below it
  6.  
  7. ]]
  8.  
  9. --[[ Functions ]]
  10. local function empty()
  11.     for i = 2, 16 do
  12.         turtle.select(i)
  13.         turtle.dropDown()
  14.     end
  15.     turtle.select(1)
  16.     local count = turtle.getItemCount()
  17.     turtle.dropDown(count - 1)
  18. end
  19.  
  20. local function farm()
  21.     local success, data = turtle.inspect()
  22.     if success and data["state"]["age"] == 7 then
  23.         turtle.dig()
  24.         turtle.select(1)
  25.         turtle.place()
  26.     end
  27. end
  28.  
  29. --[[ Main ]]
  30.  
  31. while true do
  32.     farm()
  33.     empty()
  34.     turtle.turnRight()
  35. end
  36.  
Advertisement
Add Comment
Please, Sign In to add comment