Guest User

Cryo

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