View difference between Paste ID: qgrE1qQu and QUctfhKa
SHOW: | | - or go back to the newest paste.
1
2-
-- 0yCVbCCH
2+
-- QUctfhKa
3
-- slots: seeds, fuel, detector, filter, breaker
4
5
local plotLength = 16
6
7
local function harvestPlant()
8
9
	turtle.select(5)
10
	turtle.placeDown()
11
12
	turtle.select(6)
13
	repeat until turtle.forward()
14
	repeat until turtle.down()	
15
	sleep(2)
16
	repeat until turtle.up()
17
	repeat until turtle.back()	
18
19
	turtle.select(5)
20
21
	for slot = 6, 16 do
22
		if turtle.getItemCount(5) == 0 then
23
			break
24
		end
25
		turtle.transferTo(slot)
26
	end	
27
28
29
	turtle.digDown()
30
31
	turtle.select(1)
32
	repeat until turtle.back()
33
	turtle.placeDown()
34
	repeat until turtle.forward()
35
36
end
37
38
local function testPlant()
39
40
	turtle.turnRight()
41
42
	turtle.select(3)
43
	turtle.placeDown()
44
	sleep(0)
45
	turtle.select(4)
46
	turtle.dropDown()
47
	sleep(0)
48
49
	local isGrown = rs.getInput("bottom")
50
51
	turtle.select(4)
52
	turtle.suckDown()
53
	turtle.select(3)
54
	turtle.digDown()
55
56
	turtle.select(1)
57
	sleep(0)
58
59
	if isGrown then harvestPlant() end
60
61
62
	turtle.turnLeft()
63
end
64
65
turtle.turnRight()
66
67
while turtle.getItemCount(1) ~= 0 do
68
69
	while turtle.getFuelLevel() < 64 do
70
		while turtle.getItemCount(2) < 2 do
71
			print("Out of Fuel")
72
			sleep(1)
73
		end
74
		turtle.select(2)
75
		turtle.refuel(turtle.getItemCount(2) - 1)
76
		turtle.select(1)
77
	end
78
79
	for x = 1, plotLength do
80
		testPlant()
81
		if x ~= plotLength then
82
			repeat until turtle.forward()
83
		end
84
	end
85
86
	turtle.turnRight() 
87
	repeat until turtle.forward()
88
	turtle.turnRight()
89
90
	for x = 1, plotLength do
91
		testPlant()
92
		if x ~= plotLength then
93-
end
93+
94
		end
95
	end
96
97
	turtle.turnRight() 
98
	repeat until turtle.forward()
99
	turtle.turnRight()
100
101
102
end
103
104
105
turtle.turnLeft()