CompCrafter

filler

Jun 20th, 2016
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. bucketCount = 16
  2. height = 0
  3. dir = 1
  4. function refillBucket()
  5. turtle.select(16)
  6. turtle.placeUp()
  7. turtle.select(1)
  8. for i = 1,16 do
  9. turtle.placeUp()
  10. end
  11. turtle.select(16)
  12. turtle.digUp()
  13. bucketCount = 16
  14.  
  15.  
  16. turtle.select(8)
  17. turtle.transferTo(12,1)
  18. turtle.select(12)
  19. turtle.transferTo(16,1)
  20.  
  21.  
  22. turtle.select(9)
  23. turtle.transferTo(10,64)
  24. turtle.select(10)
  25. turtle.transferTo(11,64)
  26. turtle.select(11)
  27. turtle.transferTo(13,64)
  28. turtle.select(13)
  29. turtle.transferTo(14,64)
  30. end
  31. function placeBucket()
  32. if bucketCount == 0 then
  33. refillBucket()
  34. end
  35. bucketCount = bucketCount - 1
  36. turtle.select(1)
  37. turtle.placeDown()
  38. sleep(2)
  39. end
  40. function fforward()
  41. while turtle.forward()==false do
  42. end
  43. end
  44.  
  45. function right()
  46. turtle.turnRight()
  47. end
  48. function left()
  49. turtle.turnLeft()
  50. end
  51. turtle.select(15)
  52. if turtle.compareDown()==false then
  53. print("Wrong place! Place Turtle in the left corner! Put Reactor Casing in the 15th slot!")
  54. else
  55. fforward()
  56. right()
  57. fforward()
  58. left()
  59. while turtle.detectDown()==false do
  60. turtle.down()
  61. height = height + 1
  62. end
  63. for i = 1,(height) do
  64. turtle.up()
  65. end
  66. finished = false
  67. while finished==false do
  68.  
  69. for i = 1,(height - 1) do
  70. placeBucket()
  71.  
  72. end
  73. turtle.select(14)
  74. turtle.placeDown()
  75. fforward()
  76. while turtle.detectDown() do
  77. turtle.select(15)
  78. if turtle.compareDown() then
  79.  
  80. if dir == 1 then
  81. right()
  82. fforward()
  83. right()
  84. fforward()
  85. if turtle.compareDown() then
  86. finished = true
  87. end
  88. dir = 2
  89.  
  90. else
  91. left()
  92. fforward()
  93. left()
  94. fforward()
  95. if turtle.compareDown() then
  96. finished = true
  97. end
  98. dir = 1
  99.  
  100. end
  101. else
  102. fforward()
  103. end
  104. end
  105. end
  106. end
Advertisement
Add Comment
Please, Sign In to add comment