edoreld

Untitled

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