Advertisement
Guest User

kuma.v1

a guest
Apr 10th, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.29 KB | None | 0 0
  1. local runif = true
  2. turtle.select(1)
  3. turtle.refuel()
  4. print(turtle.getFuelLevel())
  5. local selectedSlot = 2
  6. turtle.select(selectedSlot)
  7. local previousRotation = 1
  8. local turnCount = 0
  9.  
  10. while runif do
  11.     if turtle.getItemCount() == 0 then
  12.         selectedSlot = selectedSlot + 1
  13.         turtle.select(selectedSlot)
  14.     end
  15.    
  16.     if turtle.getItemCount(16) == 64 then
  17.         runif = false
  18.     else
  19.         if turtle.detect() then
  20.             turtle.dig()
  21.             turtle.forward()
  22.             turnCount = 0
  23.         else
  24.             if turnCount == 0 then
  25.                 if previousRotation == 1 then
  26.                     turtle.turnRight()
  27.                     turtle.dig()
  28.                     turtle.forward()
  29.                     turtle.dig()
  30.                     turtle.forward()
  31.                     turtle.turnRight()
  32.                     previousRotation = 0
  33.                 else
  34.                     turtle.turnLeft()
  35.                     turtle.dig()
  36.                     turtle.forward()
  37.                     turtle.dig()
  38.                     turtle.forward()
  39.                     turtle.turnLeft()
  40.                     previousRotation = 1
  41.                 end
  42.             else
  43.                 runif = false
  44.             end
  45.             turnCount = 1
  46.         end
  47.     end
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement