View difference between Paste ID: UYT7Wsmx and Wgcdf1HM
SHOW: | | - or go back to the newest paste.
1
local t = turtle
2
3
local function forward(x)
4
	for i = 1, x do
5
		t.forward()
6
	end
7
end
8
9
local function rTurn(x)
10
	for i = 1, x do
11
		t.turnRight()
12
	end
13
end
14
15
local function lTurn(x)
16
	for i = 1, x do
17
		t.turnLeft()
18
	end
19
end
20
21
local function up(x)
22
	for i = 1, x do
23
		t.up()
24
	end
25
end
26
27
local function down(x)
28
	for i = 1, x do
29
		t.down()
30
	end
31
end
32
33
local function back(x)
34
	for i = 1, x do
35
		t.back()
36
	end
37
end
38
39
local fuelAmount = t.getFuelLevel()
40
41
local function fuelCheck()
42
	if fuelAmount < 5000 then
43-
		back(3)
43+
44
		rs.setOutput("left", true)
45
		os.sleep(5)
46
		rs.setOutput("left", false)
47
		t.select(3)
48
		t.refuel(all)
49
		print("Gassed up and good to go!")
50
		forward(3)
51
	else
52
		print("Still Rollin!")
53
		forward(3)
54
	end
55
end
56
57
local sapCheck = t.getItemCount(1)
58
local boneCheck = t.getItemCount(2)
59
60
local function bonemealCheck()
61
	if t.getItemCount(2) < 30 then
62-
		back(3)
62+
63
		os.sleep(10)
64
		rs.setOutput("back", false)
65
		fuelCheck()
66
	else
67
		print("Ready to Bone")
68
		fuelCheck()
69
	end
70
end
71
72
local function saplingCheck()
73
	back(3)
74-
		back(3)
74+
75
		rs.setOutput("right", true)
76
		os.sleep(5)
77
		rs.setOutput("right", false)
78
		bonemealCheck()
79
	else
80
		print("It's time to Lay")
81
		bonemealCheck()
82
	end
83
end
84
85
local function grow()
86
	t.select(2)
87
	while t.place() do
88
		t.place()
89
	end
90
end
91
	
92
93
local function plant()
94
	t.select(1)
95
	t.place()
96
end
97
98
local function harvest()
99
	t.dig()
100
	forward(1)
101
	for i = 1, 15, 1 do
102
		t.digUp()
103
		up(1)
104
	end
105
	down(15)
106
	back(1)
107
end
108
109
while true do
110-
	os.sleep(0.5)
110+
111-
	bonemealCheck()
111+
112-
	os.sleep(0.5)
112+
113-
	fuelCheck()
113+
114
end