jkCBWPnet

getLava

May 15th, 2022 (edited)
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.34 KB | None | 0 0
  1. local function getLava()
  2.     local d = 0
  3.     while not turtle.detect() do
  4.         if turtle.forward() then
  5.             turtle.placeDown()
  6.             turtle.refuel()
  7.             d = d + 1
  8.         end
  9.     end
  10.     return d
  11. end
  12.  
  13. local distance = getLava()
  14. turtle.turnRight()
  15. turtle.turnRight()
  16. for m = 1,distance do
  17.     turtle.forward()
  18. end
  19.  
  20. print(distance.." meters.")
Add Comment
Please, Sign In to add comment