Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local torch = turtle.getItemCount(1)
- local dist = 0
- function digforw()
- if turtle.detect() then
- turtle.dig()
- end
- turtle.forward()
- dump()
- turtle.digUp()
- dump()
- dist = dist + 1
- end
- function digforl()
- turtle.turnLeft()
- turtle.up()
- for i=1,6,1 do
- if turtle.detect() then
- turtle.dig()
- end
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- for i=1,7,1 do
- turtle.forward()
- end
- turtle.down()
- turtle.turnLeft()
- end
- function digforr()
- turtle.turnRight()
- turtle.up()
- for i=1,6,1 do
- if turtle.detect() then
- turtle.dig()
- end
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- for i=1,7,1 do
- turtle.forward()
- end
- turtle.down()
- turtle.turnRight()
- end
- local fuel = turtle.getFuelLevel()
- function run()
- if fuel < 1 then
- for i = 2, 16 do -- loop through the slots
- turtle.select(i) -- change to the slot
- if turtle.refuel(0) then -- if it's valid fuel
- local halfStack = math.ceil(turtle.getItemCount(i)/2) -- work out half of the amount of fuel in the slot
- turtle.refuel(halfStack) -- consume half the stack as fuel
- end
- end
- end
- turtle.select(1)
- digforw()
- digforw()
- digforw()
- digforw()
- digforw()
- digforw()
- digforw()
- digforw()
- digforw()
- digforw()
- print("dig-l")
- digforl()
- end
- run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement