Advertisement
starkrights

utils.lua

May 27th, 2024
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. startX = 728
  2. startY = 253
  3. startZ = -169
  4.  
  5.  
  6. function gotoChunkCenter()
  7.    local x,y,z = gps.locate()
  8.    while x ~= startX or z ~= startZ do
  9.         print("Cur pos: "..x..", "..y..", "..z)
  10.         if x ~= startX then
  11.             if x > startX then
  12.                 turtle.back()
  13.             else
  14.                 turtle.forward()
  15.             end
  16.         end
  17.         turtle.turnRight()
  18.         if z ~= startZ then
  19.             if z > startZ then
  20.                 turtle.back()
  21.             else
  22.                 turtle.forward()
  23.             end
  24.         end
  25.         turtle.turnLeft()
  26.         x,y,z = gps.locate()
  27.     end
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement