Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function refuel()
- if turtle.getFuelLevel() < 1 then
- print("Attempting to Refuel!")
- if ~turtle.refuel(10) then
- print("failed to refuel")
- end
- end
- end
- function torch(x)
- if x % 5 == 0 then
- tmp=turtle.getSelectedSlot()
- turtle.turnRight()
- turtle.select(2)
- turtle.dig()
- turtle.place()
- turtle.dig()
- turtle.turnRight()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- turtle.select(tmp)
- end
- end
- function dig(n)
- for i=0, n-1 do
- refuel()
- if(turtle.detect()) then
- turtle.dig()
- end
- turtle.forward()
- if(turtle.detectUp()) then
- turtle.digUp()
- end
- end
- end
- function cleanup()
- for i=0, 3 do
- dig(1)
- turtle.turnRight()
- end
- turtle.turnLeft()
- dig(3)
- turtle.turnLeft()
- end
- function mineShaft(length)
- for i=0, length do
- dig(1)
- torch(i)
- end
- dig(length)
- turtle.turnRight()
- dig(3)
- turtle.turnRight()
- dig(length)
- end
- function mine(x, y)
- for i=0, y-1 do
- mineShaft(x)
- cleanup()
- end
- turnRight()
- for i=0, (6*y)-1 do
- turtle.forward()
- end
- end
- mine(4, 3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement