-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnether.lua
More file actions
55 lines (53 loc) · 1.37 KB
/
nether.lua
File metadata and controls
55 lines (53 loc) · 1.37 KB
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
local args = {...}
if not args[1] then
args[1] = 5
end
function torch()
for i=1,16 do
if turtle.getItemCount(i)>0 and turtle.getItemDetail(i).name == "minecraft:torch" then
turtle.select(i)
-- turn around to place torch behind self
turtle.turnLeft()
turtle.turnLeft()
turtle.place()
turtle.turnRight()
turtle.turnRight()
return true
end
end
return false
end
function refuel()
if turtle.getFuelLevel() < 200 then
-- Going backwards to use newer materials first
for i=16,1,-1 do
select(i)
if turtle.refuel(10) then return true end
end
end
return false
end
function bridge()
if not turtle.detectDown() then
for i=1,16 do
if turtle.getItemCount(i)>0 and turtle.getItemDetail(i).name == "minecraft:netherrack" then
turtle.select(i)
turtle.placeDown()
return true
end
end
end
return false
end
for i=1,args[1]+1 do
if refuel() then print("Turtle Refueled") end
bridge() -- run bridge routine
turtle.digUp()
if i%8==0 then torch() end
while not turtle.forward() do
turtle.dig()
turtle.attack()
end
if i%25==0 then print("Mined "..i.." Blocks") end
end
print("Strip Mining Complete")