minicl55

Untitled

Nov 10th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. function checkFuel()
  2. turtle.select(15)
  3. end
  4.  
  5. function moveUp()
  6. checkFuel()
  7. while(turtle.up()==false)do turtle.digUp() end
  8. end
  9.  
  10. function moveDown()
  11. checkFuel()
  12. while(turtle.down()==false)do turtle.digDown() end
  13. end
  14.  
  15. function move()
  16. checkFuel()
  17. while(turtle.forward()==false)do turtle.dig() end
  18. end
  19.  
  20. function moveBack()
  21. checkFuel()
  22. while(turtle.back()==false)do end
  23. end
  24.  
  25. local args = { ... }
  26.  
  27. function main()
  28. local quarryWidth
  29.  
  30. if(#args == 1) then
  31. quarryWidth = tonumber(args[1])
  32. if(quarryWidth<2 or quarryWidth>64) then
  33. print("Invalid Width")
  34. return
  35. end
  36. else
  37. print("Usage: "..shell.getRunningProgram().." <diameter>")
  38. return
  39. end
  40.  
  41. for temp2=2,1,-1 do
  42. for temp=quarryWidth-1,1,-1 do
  43. move()
  44. end
  45. turtle.select(2)
  46. turtle.digDown()
  47. turtle.placeDown()
  48. moveBack()
  49. turtle.select(1)
  50. turtle.place()
  51.  
  52. for temp=quarryWidth-1,2,-1 do
  53. moveBack()
  54. end
  55. turtle.turnRight()
  56. end
  57.  
  58. end
  59.  
  60. main()
Advertisement
Add Comment
Please, Sign In to add comment