Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Detects if counter variable is even or odd and determines the Turtle's turn direction
- --]]
- local function turn(a)
- if a%2==0 then
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- else
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- end
- end
- --Initialize the counter variable
- x=1
- --Make sure the Turtle has selected the slot with the seeds
- turtle.select(1)
- --The turtle harvests and replants the 7x7 field
- for i=1,7 do
- turtle.forward()
- for i=1,7 do
- turtle.digDown()
- turtle.placeDown()
- turtle.forward()
- end
- turn(x)
- x=x+1
- end
- --[[
- The Turtle returns along the outside of the field and deposits its harvest into a chest
- --]]
- for i=1,9 do
- turtle.forward()
- end
- turtle.turnRight()
- for i=1,7 do
- turtle.forward()
- end
- turtle.turnRight()
- for i=2,16 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.select(1)
- --The Turtle returns to its starting point
- turtle.forward()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement