Advertisement
CelticCoder

createConcrete

Jan 6th, 2024 (edited)
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. -- Function to build a pillar
  2. function buildPillar(newSlot)
  3.     local blockSlot = newSlot
  4.     local waterSlot = 16 -- Last slot containing water
  5.     height = 0
  6.     blockCount = turtle.getItemCount(blockSlot)
  7.     while turtle.getItemCount(blockSlot) > 0 do
  8.         turtle.select(blockSlot)
  9.         turtle.up()
  10.         turtle.placeDown()
  11.         height = height + 1
  12.     end
  13.    
  14.    
  15.     -- Place water at the top
  16.     if blockCount ~= 0 then
  17.         turtle.select(waterSlot)
  18.         turtle.placeUp()
  19.         os.sleep(1)
  20.         turtle.placeUp()
  21.         turtle.select(blockSlot)
  22.         for i = 1, height do
  23.             turtle.digDown()
  24.             turtle.down()
  25.         end
  26.     end
  27. end
  28.  
  29. slot = 1
  30. while slot ~= 16 do
  31.     buildPillar(slot)
  32.     slot = slot + 1
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement