Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local length = read()
- local width = read()
- local firstBlock = 1
- local secondBlock = 9
- for j = 0, width-1, 1 do
- for i = 0, length-1, 1 do
- if turtle.detect() then
- turtle.dig()
- end
- turtle.forward()
- turtle.turnRight()
- turtle.turnRight()
- turtle.select(firstBlock)
- if turtle.getItemCount() == 0 then
- firstBlock = firstBlock + 1
- if firstBlock > 8 then
- firstBlock = 1
- turtle.select(firstBlock)
- if turtle.getItemCount() == 0 then
- print("waiting for more primary material...")
- end
- while turtle.getItemCount() == 0 do
- sleep()
- end
- end
- end
- turtle.select(secondBlock)
- if turtle.getItemCount() == 0 then
- secondBlock = secondBlock + 1
- if secondBlock > 16 then
- secondBlock = 9
- turtle.select(secondBlock)
- if turtle.getItemCount() == 0 then
- print("waiting for more secondary material...")
- end
- while turtle.getItemCount() == 0 do
- sleep()
- end
- end
- end
- if i == 0 or i == length-1 or j == 0 or j == width-1 then
- turtle.select(firstBlock)
- turtle.place()
- else
- turtle.select(secondBlock)
- turtle.place()
- end
- turtle.turnRight()
- turtle.turnRight()
- end
- if turtle.detect() then
- turtle.dig()
- end
- if j % 2 == 0 then
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- else
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- end
- end
Add Comment
Please, Sign In to add comment