Guest User

build_wall.lua

a guest
Jun 5th, 2026
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. local l,w,h = ... -- 50, 40, 5
  2. local function build_col(h)
  3.     for ih=1,h do
  4.         turtle.up()
  5.         turtle.placeDown()
  6.         if turtle.getItemCount()==0 then
  7.             turtle.select(turtle.getSelectedSlot()+1)
  8.         end
  9.     end
  10.     turtle.forward()
  11.     while turtle.down() do end
  12. end
  13. local function build_wall(n,h)
  14.     for i=1,n do
  15.         build_col(h)
  16.     end
  17. end
  18. --[[
  19. build_wall(l-1)
  20. turtle.turnLeft()
  21. turtle.back()
  22. build_wall(w-1)
  23. turtle.turnLeft()
  24. turtle.back()
  25. build_wall(l-1)
  26. turtle.turnLeft()
  27. turtle.back()
  28. build_wall(w)]]
  29. return {build_wall=build_wall}
  30.  
Advertisement
Add Comment
Please, Sign In to add comment