Advertisement
feedmecookies

GpsApi

Nov 23rd, 2020 (edited)
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. --excavate--
  2. os.loadAPI("gps")
  3. mx = 0
  4. my = 0
  5. mz = 0
  6. function dig()
  7. while turtle.detect() do
  8. turtle.dig()
  9. end
  10. turtle.forward()
  11. end
  12.  
  13. function excavate(x,z)
  14. for i = 1, z do
  15. for o = 2, x do
  16. dig()
  17. end
  18. if gps.GetOri() == 1 and i ~= z then
  19. gps.Rotate(2)
  20. dig()
  21. gps.Rotate(3)
  22. elseif gps.GetOri() == 3 and i ~= z then
  23. gps.Rotate(2)
  24. dig()
  25. gps.Rotate(1)
  26. end
  27. end
  28. end
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement