edoreld

Untitled

Nov 2nd, 2012
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. local tArgs = {...}
  2. torchSlot = 16
  3.  
  4. local blocksToMine = 0
  5.  
  6. if #tArgs == 0 then
  7. blocksToMine = 20
  8. else
  9. blocksToMine = tonumber(tArgs[1])
  10. end
  11.  
  12. function upDown()
  13. turtle.digUp()
  14. turtle.digDown()
  15. end
  16.  
  17. function forward()
  18. while not turtle.forward() do
  19. if not turtle.dig() then
  20. turtle.attack()
  21. end
  22. end
  23. end
  24.  
  25. local torchCounter = 0
  26. local torchSpacing = 6
  27. for i=1,blocksToMine do
  28. upDown()
  29. torchCounter = torchCounter + 1
  30. if torchCounter % torchSpacing == 0 then
  31. turtle.select(torchSlot)
  32. turtle.placeDown()
  33. turtle.select(1)
  34. end
  35. turtle.dig()
  36. forward()
  37. end
  38.  
  39. turtle.select(1)
  40. for i=1,2 do
  41. turtle.turnLeft()
  42. end
  43.  
  44. for i=1,blocksToMine do
  45. forward()
  46. end
  47.  
  48. turtle.turnLeft()
  49. for i=1,4 do
  50. forward()
  51. end
  52. turtle.turnLeft()
Advertisement
Add Comment
Please, Sign In to add comment