Advertisement
augustclear

CompressCobble

Dec 27th, 2017
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.79 KB | None | 0 0
  1. local direction = "up"
  2.  
  3. local function suck()
  4.   if direction == "up" then
  5.     turtle.suckDown(1)
  6.   else
  7.     turtle.suckUp(1)
  8.   end
  9. end
  10.  
  11. local function drop(side)
  12.   turtle.select(11)
  13.   if side == "up" then
  14.     turtle.dropUp()
  15.   elseif side == "down" then
  16.     turtle.dropDown()
  17.   else
  18.     for i=1,16 do
  19.       turtle.select(i)
  20.       turtle.drop()
  21.     end
  22.   end
  23. end
  24.  
  25. local function fillCraft()
  26.   for i=1,3 do
  27.     turtle.select(i)
  28.     suck()
  29.   end
  30.   for i=5,7 do
  31.     turtle.select(i)
  32.     suck()
  33.   end
  34.   for i=9,11 do
  35.     turtle.select(i)
  36.     suck()
  37.   end
  38. end
  39.  
  40. while true do
  41.   fillCraft()
  42.   if turtle.craft(1) == false then
  43.     drop("forward")
  44.     if direction == "up" then
  45.       direction = "down"
  46.     else
  47.       direction = "up"
  48.     end
  49.   else
  50.     drop(direction)
  51.   end
  52.  
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement