Advertisement
Dimach

Turtle logger

Oct 23rd, 2012
569
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.07 KB | None | 0 0
  1. a=10
  2. b=10
  3. c=50
  4. function sss()
  5. for i=1,a-1 do
  6. if turtle.getFuelLevel()<=64 then
  7. turtle.select(16)
  8. turtle.refuel(1)
  9. end
  10. mmm()
  11. end
  12. end
  13.  
  14. function unload()
  15. for i=2,15 do
  16. turtle.select(i)
  17. turtle.dropDown(64)
  18. end
  19. end
  20.  
  21. function mmm()
  22. uuu=false
  23. if turtle.detect() then uuu=true end
  24. s=1
  25. while turtle.detect() do
  26. turtle.dig()
  27. turtle.digUp()
  28. turtle.up()
  29. s=s+1
  30. end
  31. for z=1,s-1 do
  32. turtle.digDown()
  33. turtle.down()
  34. end
  35. turtle.select(1)
  36. turtle.placeDown()
  37. turtle.forward()
  38. turtle.suckDown()
  39. if uuu then
  40. turtle.digDown()
  41. end
  42. turtle.placeDown()
  43. end
  44.  
  45. while true do
  46. unload()
  47. turtle.forward()
  48. turtle.suckDown()
  49. turtle.forward()
  50. turtle.suckDown()
  51. for n=1,b/2 do
  52. sss()
  53. turtle.turnLeft()
  54. turtle.forward()
  55. turtle.suckDown()
  56. turtle.turnLeft()
  57. sss()
  58. turtle.turnRight()
  59. turtle.forward()
  60. turtle.suckDown()
  61. turtle.turnRight()
  62. end
  63. turtle.turnRight()
  64. turtle.turnRight()
  65. turtle.forward()
  66. turtle.suckDown()
  67. turtle.forward()
  68. turtle.suckDown()
  69. turtle.turnLeft()
  70. for i=1,b do
  71. turtle.forward()
  72. turtle.suckDown()
  73. end
  74. turtle.turnLeft()
  75. unload()
  76. sleep(c)
  77. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement