Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.write("Please enter the height of wall: ")
- local h = tonumber(read())
- term.write("Please enter the width of wall: ")
- local w = tonumber(read())
- local itemID = 1
- for i = 1, w do
- for j = 1, h+1 do
- turtle.select(itemID)
- while (turtle.getItemCount() == 0) do
- itemID = itemID + 1
- if (itemID > 16) then
- break
- end
- turtle.select(itemID)
- end
- if (itemID > 16) then
- break
- end
- if (j == h+1 and i % 2 == 1) then
- turtle.up()
- turtle.place()
- turtle.down()
- turtle.placeUp()
- break
- elseif (j == 1 and i % 2 == 0) then
- turtle.up()
- turtle.place()
- turtle.down()
- turtle.placeUp()
- elseif (j == h+1 and i % 2 == 0) then
- break
- end
- if (i % 2 == 1) then
- turtle.place()
- if (j < h) then
- turtle.up()
- end
- else
- turtle.place()
- if (j < h) then
- turtle.down()
- end
- end
- end
- if (itemID > 16) then
- break
- end
- if (i == w) then
- while (not turtle.detectDown()) do
- turtle.down()
- end
- break
- end
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- end
Advertisement
Add Comment
Please, Sign In to add comment