Advertisement
phupqpr

Untitled

Sep 7th, 2023 (edited)
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. print("Checking fuel")
  2. if turtle.getFuelLevel() < 250 then
  3.     print("Refueling......")
  4.     turtle.refuel(1)
  5. else print("Getting ready")
  6. end
  7.  
  8. local Sx, Sy, Sz = gps.locate()
  9. print("Detected starting point ("..Sx..","..Sy..","..Sz..")")
  10. local home = ("("..Sx..", "..Sy..", "..Sz..")")
  11.  
  12. local yTarget = -60
  13. function goTo(Sx, yTarget ,Sz)
  14.     while yTarget < Sy do
  15.         turtle.digDown()
  16.         turtle.down()
  17.     end
  18.     while yTarget > Sy do
  19.         turtle.digUp()
  20.         turtle.up()
  21.     end
  22. end
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement