Advertisement
Guest User

Full auto Turtle - torches

a guest
Jul 22nd, 2014
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. local far=0
  2. local wide=0
  3. local high=0
  4.  
  5. term.write("How Far?")
  6. far= read()
  7. term.write("How wide?")
  8. wide= read()
  9. wide= wide-1
  10. term.write("How much higher than 3?")
  11. high= read()
  12.  
  13. function refuel()
  14. if turtle.getFuelLevel() <100 then
  15. turtle.select(1)
  16. if turtle.getItemSpace(1) == 63 then
  17. turtle.refuel()
  18. turtle.turnRight()
  19. turtle.turnRight()
  20. for i=1,turtle.getFuelLevel() do
  21. turtle.forward()
  22. end
  23. print("Ran Out of Fuel!")
  24. else
  25. turtle.refuel()
  26. end
  27. end
  28. end
  29.  
  30. function Dump()
  31. if turtle.getItemCount (14) ~=0 then
  32. for i=1,high do
  33. turtle.down()
  34. end
  35. turtle.select(15)
  36. turtle.placeDown()
  37. for i=2,14 do
  38. turtle.select(i)
  39. turtle.dropDown()
  40. end
  41. turtle.select(1)
  42. for i=1,high do
  43. turtle.up()
  44. end
  45. else
  46. end
  47. end
  48.  
  49.  
  50.  
  51.  
  52. function digIt()
  53. while turtle.detect() do
  54. turtle.dig()
  55. os.sleep(0.5)
  56. end
  57. turtle.forward()
  58. while turtle.detectDown() or turtle.detectUp() do
  59. turtle.digUp()
  60. turtle.digDown()
  61. end
  62. end
  63.  
  64. for i=1,far do
  65. digIt()
  66. turtle.turnRight()
  67. for i=1,wide do
  68. digIt()
  69. end
  70. turtle.turnRight()
  71. turtle.turnRight()
  72. for i=1,high do
  73. turtle.down()
  74. turtle.digDown()
  75. for i=1, wide do
  76. digIt()
  77. end
  78. turtle.turnRight()
  79. turtle.turnRight()
  80. end
  81. for i=1, wide do
  82. turtle.forward()
  83. end
  84. turtle.turnRight()
  85. for i=1,high do
  86. turtle.up()
  87. end
  88. Dump()
  89. refuel()
  90. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement