-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathturt.lua
62 lines (57 loc) · 1.32 KB
/
turt.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
--Commandcracker was here
local function checkFuel()
if turtle.getFuelLevel() <= 4 then
print("Out of fuel")
while true do
for i=1,16 do
turtle.select(i)
turtle.refuel()
end
if turtle.getFuelLevel() > 4 then
print("Refueled.")
break
else
print("Please put fuel in the turtles inventory and press a key.")
os.pullEvent("key")
end
end
end
end
local blacklist = {
["minecraft:cobblestone"] = true,
["minecraft:stone"] = true, -- granite, andesite, etc
["minecraft:gravel"] = true,
["chisel:limestone2"] = true,
["chisel:marble2"] = true,
}
local function dropItems()
for i=1,16 do
local detail = turtle.getItemDetail(i)
if detail and blacklist[detail.name] then
turtle.select(i)
turtle.drop()
end
end
end
local go = {}
function go.forward()
while not turtle.forward() do
turtle.dig()
end
end
for i=1,100 do
for a=1,15 do
checkFuel()
turtle.digUp()
turtle.digDown()
go.forward()
dropItems()
end
turtle.turnRight()
turtle.turnRight()
turtle.digDown()
turtle.down()
end
for i=1,100 do
turtle.up()
end