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. local torchCounter = 0
  6. local torchSpacing = 15
  7.  
  8. if #tArgs == 0 then
  9. blocksToMine = 20
  10. else
  11. blocksToMine = tonumber(tArgs[1])
  12. end
  13.  
  14. function upDown()
  15. turtle.digUp()
  16. turtle.digDown()
  17. end
  18.  
  19. function forward()
  20. while not turtle.forward() do
  21. if not turtle.dig() then
  22. turtle.attack()
  23. end
  24. end
  25. end
  26.  
  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