Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Usage: wall length height
- input = {...}
- wallLength = tonumber(input[1])
- wallHeight = tonumber(input[2])
- currentSlot = 1
- function gotoNextSlotIfEmpty()
- if turtle.getItemCount(currentSlot) == 0 then
- currentSlot = currentSlot + 1
- turtle.select(currentSlot)
- end
- end
- turtle.select(currentSlot)
- gotoNextSlotIfEmpty()
- gotoNextSlotIfEmpty()
- turtle.up()
- for height = 1, wallHeight do
- for length = 1, wallLength do
- turtle.placeDown()
- gotoNextSlotIfEmpty()
- if length ~= wallLength then
- turtle.forward()
- end
- end
- if height ~= wallHeight then
- turtle.turnRight()
- turtle.turnRight()
- turtle.up()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement