Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Functions
- local function fwd()
- while not turtle.forward() do
- turtle.dig()
- end
- end
- local function dwn() -- probably not necessary
- while not turtle.down() do
- turtle.digDown()
- end
- end
- local function betterDig()
- while turtle.detect() do
- turtle.dig()
- end
- end
- local function fwdRow()
- fwd()
- turtle.turnRight()
- betterDig()
- turtle.turnLeft()
- turtle.turnLeft()
- betterDig()
- turtle.turnRight()
- end
- local function dwnRow()
- dwn()
- turtle.turnRight()
- betterDig()
- turtle.turnLeft()
- turtle.turnLeft()
- betterDig()
- turtle.turnRight()
- end
- local function clearFace()
- for i = 1, 4 do
- turtle.up()
- end
- fwdRow()
- for i = 1, 5 do
- dwnRow()
- end
- end
- local function climb()
- turtle.up()
- fwd()
- end
- -- Main
- print("How deep?")
- local d = read()
- -- TODO: Fuel check
- -- Fuel per level is 36
- if turtle.getFuelLevel() < d * 36 then
- print("I need at least ".. (d * 36) .. " levels of fuel for that")
- end
- for i = 1, d do
- clearFace()
- end
- turtle.turnRight()
- turtle.turnRight()
- for i = 1, d do
- climb()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement