Advertisement
TrenerAmator

Untitled

Dec 15th, 2020
786
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. local SLOT_COUNT = 16
  2. local STEPS = 0
  3. function checkFuel()
  4.     turtle.select(1)
  5.     if(turtle.getFuelLevel() < 50) then
  6.         print("Attempting Refuel...")
  7.         for slot = 1, SLOT_COUNT, 1 do
  8.             turtle.select(slot)
  9.             if(turtle.refuel(1)) then
  10.                 return true
  11.             end
  12.         end
  13.  
  14.         return false
  15.     else
  16.         return true
  17.     end
  18. end
  19.  
  20. function dig()
  21.     for i = 1, 22 do
  22.         while turtle.dig() == true or turtle.forward() == true do
  23.             print("TO NIE BEDROCK")
  24.             --turtle.dig()
  25.             turtle.digDown()
  26.             turtle.digUp()
  27.             turtle.back()
  28.             if not turtle.detect() then
  29.                 checkFuel()
  30.                 turtle.forward()
  31.                 STEPS = STEPS + 1
  32.             end
  33.         end
  34.         print("WRACAM")
  35.         for n = 1, STEPS do
  36.             turtle.back()
  37.         end
  38.         turtle.turnLeft()
  39.         turtle.forward()
  40.         turtle.turnRight()
  41.         STEPS = 0
  42.     end
  43. end
  44.  
  45. dig()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement