Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local width = 9
- local height = 9
- function Left()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- end
- function Right()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- end
- function GoHome()
- local result = height % 2
- if result == 1 then
- for y = 1, height do
- turtle.forward()
- end
- turtle.turnRight()
- for x = 1, width do
- turtle.forward()
- end
- turtle.turnRight()
- else
- turtle.back()
- turtle.turnLeft()
- for x = 1, width do
- turtle.forward()
- end
- turtle.turnRight()
- end
- end
- function Harvest()
- turtle.forward()
- for y = 1, height do
- for x = 1, width do
- turtle.digDown()
- turtle.suckDown()
- if x < width then
- turtle.forward()
- end
- end
- local result = y % 2
- if result == 0 then
- Left()
- else
- Right()
- end
- end
- end
- function Dump()
- for z = 1, 16 do
- turtle.select(z)
- turtle.dropDown()
- end
- end
- function Replant()
- for i = 1, 16 do
- turtle.suckUp(i)
- end
- turtle.forward()
- for y = 1, height do
- for x = 1, width do
- turtle.placeDown(1)
- if x < width then
- turtle.forward()
- end
- end
- local result = y % 2
- if result == 0 then
- Left()
- else
- Right()
- end
- end
- end
- Harvest()
- GoHome()
- Dump()
- sleep(15)
- Replant()
- GoHome()
- Dump()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement