Advertisement
robbim97

FillHole

Jan 27th, 2023 (edited)
1,056
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.92 KB | None | 0 0
  1. selectedSlot = 2
  2.  
  3. function tanken()
  4.     while turtle.getFuelLevel() <= 240 do
  5.         turtle.select(1)
  6.         turtle.refuel(1)
  7.         turtle.select(selectedSlot)
  8.     end
  9. end
  10.  
  11. function items()
  12.     if turtle.getItemCount(selectedSlot) <= 1 then
  13.         selectedSlot = selectedSlot + 1
  14.         if selectedSlot == 17 then
  15.           selectedSlot = 2
  16.         end
  17.         turtle.select(selectedSlot)
  18.     end
  19. end
  20.  
  21. function checkup()
  22.     turtle.turnRight()
  23.     if turtle.detect() then
  24.         turtle.up()
  25.         turtle.placeDown()
  26.         while turtle.back() do
  27.             tanken()
  28.         end
  29.         turtle.turnRight()
  30.         while turtle.back() do
  31.             tanken()
  32.         end
  33.         turtle.turnRight()
  34.         turtle.turnRight()
  35.     else
  36.         turtle.turnRight()
  37.         turtle.turnRight()
  38.     end
  39. end
  40.  
  41. while true do
  42.     turtle.select(selectedSlot)
  43.     while turtle.back() do
  44.         tanken()
  45.         items()
  46.         turtle.place()
  47.     end
  48.     checkup()
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement