Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- This program is an alternate version of stripmine.lua meant to be used with another turtle.
- This one is responsible for making the left side of the strip mining tunnel
- stripRight.lua is responsible for the right side.
- ]]
- --[[ Constants ]]
- JUNK = {
- "minecraft:cobbled_deepslate",
- "minecraft:cobblestone",
- "minecraft:tuff",
- "minecraft:dirt",
- "minecraft:gravel",
- "minecraft:granite",
- "minecraft:andesite",
- "minecraft:diorite",
- "minecraft:dripstone_block",
- "minecraft:pointed_dripstone",
- "minecraft:netherrack"
- }
- --[[ 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
- local function dropJunk() -- Drops junk
- for i = 1, 16 do
- turtle.select(i)
- if turtle.getItemCount() > 1 then
- local name = turtle.getItemDetail()["name"]
- for j = 1, #JUNK do
- if name == JUNK[j] then
- turtle.dropDown()
- end
- end
- end
- end
- end
- --[[ Main ]]
- -- 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) < 32 then
- print("Please place 32 torches in slot 1 and try again")
- return
- end
- if turtle.getFuelLevel() < 562 then
- print("Please refuel to 562 and try again")
- return
- end
- -- Dig out the main tunnel
- fwd() -- First column of tunnel
- for i = 1, 124 do
- fwd()
- end
- dropJunk()
- for i = 1, 124 do
- turtle.back()
- end
- -- Place torches
- turtle.select(1) -- Select the torches
- 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
- dropJunk()
- for i = 0, 124 do
- turtle.back()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement