Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- params = {...}
- floorLength = tonumber(params[1])
- floorWidth = tonumber(params[2])
- currentSlot = 1
- turnRight = true
- function gotoNextSlotIfEmpty()
- if turtle.getItemCount(currentSlot) == 0 then
- currentSlot = currentSlot + 1
- turtle.select(currentSlot)
- end
- end
- turtle.select(currentSlot)
- turtle.up()
- for width = 1, floorWidth>=width do
- for length = 1, floorLength>=length do
- turtle.placeDown()
- gotoNextSlotIfEmpty()
- if length ~= floorLength then
- turtle.forward()
- end
- end
- if turnRight then
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- else
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- end
- turnRight = not turnRight
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement