Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function selectTorch()
- for slot = 1, 16 do
- local item = turtle.getItemDetail(slot)
- if item and item.name == "minecraft:torch" then
- turtle.select(slot)
- return true
- end
- end
- return false
- end
- local function placeTorch()
- if selectTorch() then
- turtle.placeUp()
- end
- end
- local function mineForward()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- end
- local function stripMine(length)
- for i = 1, length do
- mineForward()
- if i % 5 == 0 then
- turtle.turnLeft()
- turtle.turnLeft()
- placeTorch()
- turtle.turnRight()
- turtle.turnRight()
- end
- end
- end
- local function main()
- print("Enter the length of the strip mine:")
- local length = tonumber(io.read())
- stripMine(length)
- print("Mining complete!")
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment