View difference between Paste ID: m7mSPUdX and sLNmV4yj
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)
44
		rs.setOutput("left", true)
45
		os.sleep(5)
46
		rs.setOutput("left", false)
47
		t.select(3)
48
		t.refuelAll()
49
		forward(3)
50
		t.print("Gassed up and good to go!")
51
	else
52
		t.print("Still Rollin!")
53
	end
54
end
55
56
local itemCheck = t.getItemCount()
57
58
local function bonemealCheck()
59
	t.select(2)
60
	if itemCheck < 10 then
61
		back(3)
62
		rs.setOutput("back", true)
63
		os.sleep(15)
64
		rs.setOutput("back", false)
65
		forward(3)
66
	else
67
		t.print("Ready to Bone")
68
	end
69
end
70
71
local function saplingCheck()
72
	t.select(1)
73
	if itemCheck < 5 then
74
		back(3)
75
		rs.setOutput("right", true)
76
		os.sleep(5)
77
		rs.setOutput("right", false)
78
		forward(3)
79
	else
80
		t.print("It's time to Lay")
81
	end
82
end