Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Will create an air shaft to the surface
- function checkfuel()
- if turtle.getFuelLevel() == 0 then
- print "Out of Fuel"
- exit()
- end
- end
- function findCeiling()
- while not turtle.detectUp() do
- turtle.up()
- checkfuel()
- sleep(0)
- end
- end
- function digShaft()
- while turtle.detectUp() do
- if turtle.digUp() then turtle.up() end
- checkfuel()
- sleep(0)
- end
- end
- function park()
- local turns = 0
- while turtle.detect() do
- turtle.turnLeft()
- turns = turns + 1
- if turns % 4 == 0 then
- if turtle.detectUp() then turtle.digUp() end
- turtle.up()
- checkfuel()
- end
- sleep(0)
- end
- turtle.forward()
- end
- findCeiling()
- digShaft()
- park()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement