Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DIG = 0
- MOVE = 0
- PLACE = 0
- function CleanTop()
- turtle.turnLeft()
- if Eval(turtle.inspect()) then
- Replace()
- end
- turtle.turnRight()
- turtle.turnRight()
- if Eval(turtle.inspect()) then
- Replace()
- end
- turtle.turnLeft()
- if Eval(turtle.inspectUp()) then
- ReplaceUp()
- end
- end
- function Eval(succ, block)
- if block.name == "minecraft:stone" and block.metadata == 0 then
- return false
- elseif block.name == "minecraft:torch" then
- return false
- else
- return true
- end
- end
- function Replace()
- turtle.dig()
- DIG = DIG + 1
- turtle.select(1)
- placed = turtle.place()
- if not placed then
- Replace()
- end
- PLACE = PLACE + 1
- end
- function ReplaceUp()
- turtle.digUp()
- DIG = DIG + 1
- turtle.select(1)
- turtle.placeUp()
- PLACE = PLACE + 1
- end
- function ReplaceDown()
- succ, block = turtle.inspect()
- if block.name ~= "minecraft:birch_planks" then
- turtle.digDown()
- DIG = DIG + 1
- turtle.select(1)
- turtle.placeDown()
- PLACE = PLACE + 1
- end
- end
- function Run()
- turtle.turnLeft()
- turtle.turnLeft()
- while not turtle.detect() do
- turtle.forward()
- end
- end
- function SetStop()
- turtle.select(2)
- turtle.place()
- end
- function Empty()
- for block=3, 16 do
- turtle.select(block)
- turtle.dropDown()
- end
- end
- function EvalComplete()
- turtle.select(1)
- if turtle.getItemCount() > 3 then
- turtle.back()
- turtle.down()
- end
- end
- Run()
- turtle.select(1)
- turtle.dig()
- while turtle.getItemCount() >= 3 and not turtle.detect() do
- CleanTop()
- turtle.forward()
- MOVE = MOVE + 1
- end
- SetStop()
- Run()
- Empty()
- print('Blocks Placed: ' .. PLACE)
- print('Moved: ' .. MOVE)
- print('Blocks Broken: ' .. DIG)
- print('Fuel: ' .. turtle.getFuelLevel())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement