Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. function findSakura()
  2. for i = 1, 16 do
  3. turtle.select(i)
  4. local name = turtle.getItemDetail()
  5. if name.name == "Natura:planks" then return end
  6. end
  7. end
  8.  
  9. function findPine()
  10. for i = 1, 16 do
  11. turtle.select(i)
  12. local name = turtle.getItemDetail()
  13. if name.name = "minecraft:planks" then return end
  14. end
  15. end
  16.  
  17. function findTorches()
  18. for i = 1, 16 do
  19. turtle.select(i)
  20. local name = turtle.getItemDetail()
  21. if name.name = "minecraft:torch" then return end
  22. end
  23. end
  24.  
  25. function ChangeWall()
  26. if turtle.detectUp() then turtle.digUp() end
  27. turtle.up()
  28. if turtle.detectUp() then turtle.digUp() end
  29. turtle.up()
  30. if turtle.detectUp() then turtle.digUp() end
  31. turtle.up()
  32. if turtle.detectBack() then turtle.turnRight() turtle.turnRight() turtle.dig() turtle.turnRight() turtle.turnRight() end
  33. turtle.dig()
  34. turtle.forward()
  35. turtle.digDown()
  36. turtle.down()
  37. findPine()
  38. turtle.placeUp()
  39. turtle.digDown()
  40. turtle.down()
  41. findSakura()
  42. turtle.placeUp()
  43. turtle.digDown()
  44. turtle.down()
  45. turtle.placeUp()
  46. turtle.back()
  47. turtle.place()
  48. end
  49.  
  50. function SwitchWall()
  51. turtle.turnRight()
  52. turtle.turnRight()
  53. turtle.forward()
  54. turtle.forward()
  55. turtle.forward()
  56. end
  57.  
  58. function placeTorch()
  59. turtle.up()
  60. turtle.findTorches()
  61. turtle.placeUp()
  62. turtle.down()
  63. end
  64.  
  65. local run = 0
  66.  
  67. print("Length:")
  68.  
  69. run = read()
  70.  
  71. turtle.forward()
  72. turtle.turnLeft()
  73.  
  74. for i=1, run do
  75. ChangeWall()
  76. if (i % 5) == 0 then placeTorch() end
  77. SwitchWall()
  78. ChangeWall()
  79. if (i % 5) == 0 then placeTorch() end
  80. turtle.turnLeft()
  81. turtle.forward()
  82. turtle.turnRight()
  83. turtle.forward()
  84. turtle.forward()
  85. turtle.forward()
  86. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement