HamBrick327

Carrot

Jun 21st, 2022 (edited)
760
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.14 KB | None | 0 0
  1. local t = turtle
  2. local isBlock
  3. local data
  4. local toggle = true
  5. local first = true
  6.  
  7. function refuel()
  8.     t.select(1)
  9.     t.refuel()
  10.     t.select(2)
  11. end
  12.  
  13. function purge()
  14.     for slot = 3, 16, 1 do
  15.         t.select(slot)
  16.         t.dropDown()
  17.     end
  18.     t.select(2)
  19. end
  20.  
  21. while true do
  22.     for i = 0, 7, 1 do
  23.         if (not first) then
  24.         purge()
  25.         if (toggle) then
  26.             t.turnRight()
  27.             t.forward()
  28.             t.turnRight()
  29.             toggle = false
  30.         else
  31.             t.turnLeft()
  32.             t.forward()
  33.             t.turnLeft()
  34.             toggle = true
  35.         end
  36.         end
  37.         for i = 0, 7, 1 do
  38.             isBlock, data = t.inspectDown()
  39.             if (isBlock) then
  40.                 if (data['state']['age'] == 7) then
  41.                     t.digDown()
  42.                     t.suckDown()
  43.                     t.placeDown('minecraft:carrot')
  44.                 end
  45.             end
  46.             t.forward()
  47.             refuel()
  48.         end
  49.         first = false
  50.     end
  51.     t.turnRight()
  52.    
  53.     for i = 0, 6, 1 do
  54.         t.forward()
  55.     end
  56.     t.turnRight()
  57.    
  58. end
Add Comment
Please, Sign In to add comment