Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This function digs a layer of the wall
- function digLayer()
- -- Dig the front row
- turtle.dig()
- turtle.forward()
- turtle.dig()
- turtle.forward()
- turtle.dig()
- turtle.back()
- turtle.back()
- -- Dig the back row
- turtle.dig()
- turtle.back()
- turtle.dig()
- turtle.back()
- turtle.dig()
- turtle.forward()
- turtle.forward()
- end
- -- This function places a layer of blocks
- function placeLayer()
- -- Place blocks in the front row
- while not turtle.place() do
- -- If the current slot is empty, check the next slot
- if turtle.getItemCount() == 0 then
- if not turtle.select(turtle.getSelectedSlot() % 16 + 1) then
- -- If there are no more slots, break out of the loop
- break
- end
- end
- end
- turtle.forward()
- while not turtle.place() do
- -- If the current slot is empty, check the next slot
- if turtle.getItemCount() == 0 then
- if not turtle.select(turtle.getSelectedSlot() % 16 + 1) then
- -- If there are no more slots, break out of the loop
- break
- end
- end
- end
- turtle.forward()
- while not turtle.place() do
- -- If the current slot is empty, check the next slot
- if turtle.getItemCount() == 0 then
- if not turtle.select(turtle.getSelectedSlot() % 16 + 1) then
- -- If there are no more slots, break out of the loop
- break
- end
- end
- end
- turtle.back()
- turtle.back()
- -- Place blocks in the back row
- while not turtle.place() do
- -- If the current slot is empty, check the next slot
- if turtle.getItemCount() == 0 then
- if not turtle.select(turtle.getSelectedSlot() % 16 + 1) then
- -- If there are no more slots, break out of the loop
- break
- end
- end
- end
- turtle.back()
- while not turtle.place() do
- -- If the current slot is empty, check the next slot
- if turtle.getItemCount() == 0 then
- if not turtle.select(turtle.getSelectedSlot() % 16 + 1) then
- -- If there are no more slots, break out of the loop
- break
- end
- end
- end
- turtle.back()
- while not turtle.place() do
- -- If the current slot is empty, check the next slot
- if turtle.getItemCount() == 0 then
- if not turtle.select(turtle.getSelectedSlot() % 16 + 1) then
- -- If there are no more slots, break out of the loop
- break
- end
- end
- end
- turtle.forward()
- turtle.forward()
- end
- -- Dig the foundation of the wall
- digLayer()
- turtle.turnRight()
- digLayer()
- turtle.turnRight()
- digLayer()
- turtle.turnRight()
- digLayer()
- -- Build the wall
- for i=1,3 do
- -- Place the blocks for the layer
- placeLayer()
- turtle.turnRight()
- placeLayer()
- turtle.turnRight()
- placeLayer()
- turtle.turnRight()
- placeLayer()
- -- Move to the next layer
- turtle.up()
- end
- -- Return to the starting position
- turtle.turnRight()
- turtle.turnRight()
- for i=1,3 do
- turtle.down()
- end
Add Comment
Please, Sign In to add comment