dougdudu

Untitled

Sep 9th, 2020 (edited)
956
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. while table.pack(gps.locate(5))[3] ~= -147 do
  2.     if turtle.getFuelLevel() ~= "unlimited" and turtle.getFuelLevel() < 1 then
  3.         turtle.refuel()
  4.     end
  5.  
  6.     success, data = turtle.inspectUp()
  7.  
  8.     index = 0
  9.  
  10.     while success and (data.name ~= "minecraft:air") do
  11.         turtle.digUp()
  12.         turtle.up()
  13.     index = index + 1
  14.         success, data = turtle.inspect()
  15.     end
  16.  
  17.     if table.pack(turtle.inspect())[2].name ~= "minecraft:air" then
  18.         turtle.dig()
  19.     end
  20.  
  21.     turtle.forward()
  22.  
  23.     if index ~= 0 then
  24.         for i = 0, index - 1, 1 do
  25.             turtle.digDown()
  26.         turtle.down()
  27.         end
  28.     end
  29.  
  30.     print('moved foward')
  31. end
Add Comment
Please, Sign In to add comment