DubstepDentist icon

Test Plant

DubstepDentist | PRO | 03/28/14 09:49:55 PM UTC | 0 ⭐ | 175 šŸ‘ļø | Never ā° | []
text |

970 B

|

None

|

0 šŸ‘

/

0 šŸ‘Ž

currentSlot = 1
turtle.select(currentSlot)
function Planting(rows, rowLength)
	for i = 1,rows do
		for x = 1,(rowLength-1) do
			Plant()
			turtle.forward()
		end
		Plant()
		if (i == rows) then
			break;
		end
		if (i % 2 == 0) then
			turtle.turnLeft()
			turtle.forward()
			turtle.turnLeft()
		else 
			turtle.turnRight()
	        turtle.forward()
	        turtle.turnRight()
        end
    end
    if (rows % 2 == 0) then
    	turtle.turnRight()
		for i = 1,(rowLength-1) do
            turtle.forward()
        end
	else 
		turtle.turnLeft()
		for i = 1,(rowLength-1) do
            turtle.forward()
        end
		turtle.turnLeft()
		for i = 1,(rowLength-1) do
                turtle.forward()
        end
		turtle.turnLeft()
		turtle.turnLeft()
    end
end
function Plant()
	items = turtle.getItemCount(currentSlot)
	if items == 0 then
		currentSlot = currentSlot+1
		turtle.select(currentSlot)
	end
	turtle.placeDown()
end
Planting(9, 9)

Comments