Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This prepares a 2 x 3 tunnel for strip mining
- -- Check if the turtle has enough torches in slot 1
- if turtle.getItemDetail(1)["name"] ~= "minecraft:torch" then
- print("Please place torches in slot 1 and try again")
- return
- end
- if turtle.getItemCount(1) < 64 then
- print("Please place 64 torches in slot 1 and try again")
- return
- end
- if turtle.getFuelLevel() < 1123 then
- print("Please refuel to 1123 and try again")
- return
- end
- -- Functions
- local fwd = function ()
- while not turtle.forward() do
- turtle.dig()
- end
- turtle.digUp()
- turtle.digDown()
- end
- local function branchFwd()
- while not turtle.forward() do
- turtle.dig()
- end
- end
- local function branch() -- Digs one branch and returns to starting position
- turtle.turnLeft()
- for i = 1, 5 do
- branchFwd()
- turtle.digDown()
- end
- for i = 1, 5 do
- turtle.back()
- end
- turtle.turnRight()
- end
- -- Dig out the main tunnel
- fwd() -- First column of tunnel
- for i = 0, 124 do
- fwd()
- end
- turtle.turnRight()
- fwd()
- turtle.turnRight()
- for i = 0, 124 do
- fwd()
- end
- -- Place torches
- turtle.select(1) -- Select the torches
- turtle.turnRight() -- Get back to starting position
- fwd()
- turtle.turnRight()
- turtle.placeUp() -- Place first torch
- for i = 0, 124 do
- if i % 4 == 0 then
- turtle.placeUp()
- if i ~= 0 then
- branch()
- end
- end
- if i ~= 124 then
- fwd()
- end
- end
- turtle.turnRight()
- fwd()
- turtle.turnRight()
- turtle.placeUp()
- for i = 0, 124 do
- if i % 4 == 0 then
- turtle.placeUp()
- if i ~= 124 then
- branch()
- end
- end
- fwd()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement