Advertisement
BombBloke

Wallbuilder (ComputerCraft)

Jan 12th, 2014
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.93 KB | None | 0 0
  1. local curslot, currow = 1,1
  2.  
  3. while true do
  4.     if currow == 1 then
  5.         while turtle.up() do end
  6.        
  7.         for i=1,16 do if turtle.getItemCount(i) > 0 then
  8.             turtle.select(i)
  9.             turtle.dropUp()
  10.         end end
  11.        
  12.         curslot = 1
  13.         turtle.select(curslot)
  14.        
  15.         for i=1,16 do turtle.suckUp() end
  16.  
  17.         while not (turtle.detect() or turtle.detectDown()) do
  18.             while not turtle.down() do turtle.attackDown() end
  19.         end
  20.  
  21.         if turtle.detect() then if not turtle.up() then error() end end
  22.     end
  23.  
  24.     for j=1,48 do
  25.         if turtle.getItemCount(curslot) == 0 then
  26.             curslot = curslot + 1
  27.             turtle.select(curslot)
  28.         end
  29.  
  30.         turtle.place()
  31.  
  32.         if j<48 then
  33.             if bit.band(currow,1)==1 then
  34.                 turtle.turnRight()
  35.                 turtle.forward()
  36.                 turtle.turnLeft()
  37.             else
  38.                 turtle.turnLeft()
  39.                 turtle.forward()
  40.                 turtle.turnRight()
  41.             end
  42.         end
  43.     end
  44.    
  45.     currow = currow + 1
  46.     if currow > 20 then currow = 1 end
  47.    
  48.     if not turtle.up() then error() end
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement