Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local MIN_FUEL = 300
- local AUTO_REFUEL = true
- local function refuel()
- for i = 1, 16 do
- turtle.select(i)
- turtle.refuel()
- end
- turtle.select(1)
- end
- local function clearDrop()
- if AUTO_REFUEL and turtle.getFuelLevel() < MIN_FUEL then refuel() end
- for slot = 1, 16 do
- turtle.select(slot)
- turtle.dropDown()
- end
- end
- function forward()
- while not turtle.forward() do
- turtle.attack()
- sleep(1)
- end
- end
- local function up()
- while not turtle.up() do
- if not turtle.digUp() then
- turtle.attackUp()
- sleep(1)
- end
- end
- h = h+1
- end
- local function down()
- while not turtle.down() do
- if not turtle.digDown() then
- turtle.attackDown()
- sleep(1)
- end
- end
- h = h-1
- end
- local function left()
- turtle.turnLeft()
- end
- local function right()
- turtle.turnRight()
- end
- local function around()
- right()
- right()
- end
- local function returnWall()
- while true do
- local state, typeblock = turtle.inspect()
- if typeblock.name ~= 'minecraft:cobblestone' then
- forward()
- else
- right()
- break
- end
- end
- end
- local function returnMatka()
- while true do
- forward()
- end
- end
- local function digHole()
- h = 0
- while true do
- local state, typeblock = turtle.inspectDown()
- if typeblock.name ~= 'minecraft:bedrock' then
- down()
- turtle.dig()
- else
- break
- end
- end
- end
- local function returnSurface()
- while h~=0 do
- turtle.dig()
- up()
- end
- end
- local function main()
- os.setComputerLabel("BABY-"..os.getComputerID())
- term.clear()
- term.setCursorPos(1,1)
- print('Fuel level: ', turtle.getFuelLevel())
- print('Easy dig running!')
- peripheral.call('left','turnOn')
- peripheral.call('right','turnOn')
- refuel()
- if turtle.getFuelLevel() < MIN_FUEL then
- error('Fatal ERROR, put fuel in any slot end PRESS Ctrl+R!')
- end
- digHole()
- around()
- for i = 1, 4 do up() end
- while turtle.detect() do turtle.dig() end
- forward()
- while true do
- local state, typeblock = turtle.inspectDown()
- if typeblock.name ~= 'minecraft:bedrock' then
- down()
- else
- break
- end
- end
- returnSurface()
- around()
- returnWall()
- clearDrop()
- returnMatka()
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement