Lion4ever

Dig Circle

Sep 13th, 2013
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. os.loadAPI("t")
  2. local start = t.getPos()
  3. write("Radius: ")
  4. local radius = tonumber(read())
  5. for i=-radius,radius do
  6. for j=-radius,radius do
  7. local k=(i%2==0 and j or -j)
  8. if (start:toVector() - vector.new(i,start.y,k)):length()<(radius-0.5) then
  9. while not t.goto(i,start.y,k) do sleep(20) turtle.dig() end
  10. if turtle.detectDown() then
  11. turtle.digDown()
  12. end
  13. if turtle.getItemCount(16)>0 then
  14. turtle.placeDown()
  15. for o=2,16 do
  16. turtle.select(o)
  17. turtle.dropDown()
  18. end
  19. while turtle.getFuelLevel()<1000 do
  20. print("Fuel empty")
  21. turtle.refuel()
  22. sleep(120)
  23. end
  24. turtle.select(1)
  25. turtle.digDown()
  26. end
  27. end
  28. end
  29. end
  30. start()
Advertisement
Add Comment
Please, Sign In to add comment