Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --first two slots are base mats
- x,y,z = 0,0,0
- local length = 10
- local width = 10
- local height = 10
- function ClearLand(length,height)
- --will clear land for building.
- for i=1,length do
- matLeft = turtle.getItemCount(1)
- if matLeft <= 1 then
- turtle.select(2)
- else
- turtle.select(1)
- end
- frontB = turtle.detect()
- upB = turtle.detectUp()
- downB = turtle.detectDown()
- if frontB and i<length then
- turtle.dig()
- end
- if upB then
- turtle.digUp()
- turtle.up()
- y=y+1
- local curH = 0
- for p=1,height do
- upB2 = turtle.detectUp()
- curH = curH + 1
- if upB2 then
- turtle.digUp()
- turtle.up()
- y=y+1
- else
- break
- end
- end
- print(curH)
- for q=1,curH do
- turtle.down()
- y=y-1
- end
- end
- if downB == false then
- turtle.placeDown()
- else
- turtle.digDown()
- turtle.placeDown()
- end
- if i < length then
- turtle.forward()
- x=x+1
- end
- end
- print("Finished column.")
- end
- function main(length,width,height)
- for i=1,width do
- ClearLand(length,height)
- if i < width and i%2==0 then
- turtle.turnLeft()
- local block = turtle.detect()
- if block then
- turtle.dig()
- end
- turtle.forward()
- turtle.turnLeft()
- else
- turtle.turnRight()
- block = turtle.detect()
- if block then
- turtle.dig()
- end
- turtle.forward()
- turtle.turnRight()
- end
- end
- print("I'm done.")
- end
- main(length,width,height)
Add Comment
Please, Sign In to add comment