View difference between Paste ID: QUctfhKa and 0yCVbCCH
SHOW: | | - or go back to the newest paste.
1
2-
-- 0s8EKQTp
2+
-- 0yCVbCCH
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
	turtle.digDown()
21
22
	turtle.select(1)
23
	repeat until turtle.back()
24
	turtle.placeDown()
25
	repeat until turtle.forward()
26
27
end
28
29
local function testPlant()
30
31
	turtle.turnRight()
32
33-
	while turtle.getItemCount(1) < 2 do
33+
34-
		print("Out of Seeds")
34+
35-
		sleep(1)
35+
36
	turtle.select(4)
37
	turtle.dropDown()
38
	sleep(0)
39
40
	local isGrown = rs.getInput("bottom")
41
42
	turtle.select(4)
43
	turtle.suckDown()
44
	turtle.select(3)
45
	turtle.digDown()
46
47
	turtle.select(1)
48
	sleep(0)
49
50
	if isGrown then harvestPlant() end
51
52
53
	turtle.turnLeft()
54
end
55
56
turtle.turnRight()
57
58
while turtle.getItemCount(1) ~= 0 do
59
60
	while turtle.getFuelLevel() < 64 do
61
		while turtle.getItemCount(2) < 2 do
62
			print("Out of Fuel")
63
			sleep(1)
64
		end
65
		turtle.select(2)
66
		turtle.refuel(turtle.getItemCount(2) - 1)
67
		turtle.select(1)
68
	end
69
70
	for x = 1, plotLength do
71
		testPlant()
72
		if x ~= plotLength then
73
			repeat until turtle.forward()
74
		end
75
	end
76-
		if x ~- plotLength then
76+
77
	turtle.turnRight() 
78
	repeat until turtle.forward()
79
	turtle.turnRight()
80
81
	for x = 1, plotLength do
82
		testPlant()
83
		if x ~= plotLength then
84
			repeat until turtle.forward()
85
		end
86
	end
87-
		if x ~- plotLength then
87+
88
	turtle.turnRight() 
89
	repeat until turtle.forward()
90
	turtle.turnRight()
91
92
93
end