Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- length = 6
- width = 5
- height = 5
- -- getting the neccessary amount of fuel
- success = turtle.refuel(math.ceil(length * height * width / 160))
- if not success then
- print("place the fuel to the active slot")
- exit()
- end
- -- [[ main code ]] --
- length = length - 1
- width = width - 1
- height = height - 1
- h = 0
- repeat
- local j = 0
- repeat
- local i = 0
- repeat
- turtle.dig()
- turtle.forward()
- i = i + 1
- until (h % 2 == 0 and i >= width) or (h % 2 ~= 0 and i >= length)
- if j % 2 == 0 and ((h % 2 == 0 and j < length) or (h % 2 ~= 0 and j < width)) then
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- elseif ((h % 2 == 0 and j < length) or (h % 2 ~= 0 and j < width)) then
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- end
- j = j + 1
- until (h % 2 == 0 and j >= length + 1) or (h % 2 ~= 0 and j >= width + 1)
- turtle.digDown()
- turtle.down()
- if h % 2 == 0 then
- if width % 2 == 0 then
- turtle.turnLeft()
- else
- turtle.turnRight()
- end
- else
- if width % 2 == 0 then
- turtle.turnRight()
- else
- turtle.turnLeft()
- end
- end
- h = h + 1
- until h == height
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement