Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- pastbin.com/Edbsn4ga
- local tArgs = { ... }
- local length = 10
- local torch_slot = 16
- local fuel_slot = 15
- if #tArgs ~= 1 then
- print('Usage: hMine <length>')
- return
- else
- length = tonumber(tArgs[1])
- end
- function hMine()
- textutils.slowPrint(string.format('Mining forward %d blocks...', length))
- for i = 1, length, 1 do
- turtle.forward()
- detectDig()
- if i % 10 == 0 then
- placeTorch()
- end
- end
- placeTorch()
- print(string.format('Finished mining %d blocks!', length))
- end
- function detectDig()
- while(turtle.detect() == true) do
- turtle.dig()
- end
- while(turtle.detectUp() == true) do
- turtle.digUp()
- end
- turtle.digDown()
- end
- function placeTorch()
- local slotData = turtle.getItemDetail(torch_slot)
- if slotData.name == "minecraft:torch" then
- turtle.select(torch_slot)
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.place()
- turtle.turnLeft()
- turtle.turnLeft()
- else
- return
- end
- end
- hMine()
- if (tArgs == "down" or tArgs == "Down") then
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement