WineCraftHD

Decompress Slabs

Dec 18th, 2015
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.58 KB | None | 0 0
  1. -- Assume that spots 5-16 are empty (wouldn't need slabs to constructing bridge)
  2. -- 1-4 are: Chest, Coal, Triple Compressed Cobblestone, Double Compressed Cobblestone
  3.  
  4. -- place chest above for inventory, chest below for stacks
  5. turtle.select(1) turtle.digUp() turtle.digDown()
  6.  
  7. -- use a crafty mining/digging turtle to avoid this
  8. if not turtle.placeUp() or not turtle.placeDown() then os.shutdown() end
  9.  
  10. -- leave only double compressed in inventory.
  11. -- if 3 or less double compressed, make 54 new double compressed
  12. turtle.select(1) if turtle.getItemCount(4) < 4 then turtle.dropUp() turtle.select(2) turtle.dropUp() turtle.select(4) turtle.dropUp() turtle.craft(6) turtle.select(3) turtle.dropUp() else for i=1,3 do turtle.select(i) turtle.dropUp() end end
  13.  
  14. -- make 18 compressed, deposit double compressed
  15. turtle.select(5) turtle.craft(2) turtle.select(4) turtle.dropUp()
  16.  
  17. -- decompress into 3 stacks
  18. turtle.select(6) turtle.craft(6) turtle.dropDown() turtle.craft(6) turtle.dropDown() turtle.craft(9)
  19.  
  20. -- suck up two stacks of cobblestone, balance stacks
  21. turtle.select(5) turtle.suckDown() turtle.select(7) turtle.suckDown() turtle.select(5) turtle.transferTo(7, 10) turtle.select(8)
  22.  
  23. -- should have 3 stacks of 54 cobblestone. 6 slabs per craft means we can craft at most 10 at a time. Rounding up 54/10 gives us 6 iterations.
  24. for i=1,5 do turtle.craft(10) turtle.dropDown() end turtle.craft(10)
  25.  
  26. -- starting at index 1, get all of our stuff back
  27. turtle.select(1) while turtle.suckUp() do end while turtle.suckDown() do end
  28.  
  29. -- get our chests back
  30. turtle.digUp() turtle.digDown()
Advertisement
Add Comment
Please, Sign In to add comment