Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- glow = 0
- function moveForward()
- repeat
- turtle.dig()
- until turtle.forward()
- end
- function mineUp()
- repeat
- turtle.digUp()
- until turtle.up()
- end
- function refuel()
- if turtle.getFuelLevel() <= 5 then
- turtle.select(16)
- turtle.refuel(1)
- end
- end
- function selectLadder()
- turtle.select(15)
- if turtle.getItemCount(15) == 1 then
- turtle.select(1)
- while not turtle.compareTo(15) do
- for i = 1,12 do
- turtle.select(i)
- end
- end
- end
- end
- function selectDirt()
- turtle.select(14)
- if turtle.getItemCount(14) == 1 then
- turtle.select(1)
- while not turtle.compareTo(14) do
- for i = 1,12 do
- turtle.select(i)
- end
- end
- end
- end
- function placeLadder()
- selectLadder()
- if not turtle.place() then
- selectDirt()
- moveForward()
- turtle.place()
- turtle.back()
- selectLadder()
- if not turtle.place() then
- return false
- end
- end
- end
- function torch()
- if glow == 6 then
- turtle.digDown()
- turtle.select(13)
- turtle.placeDown()
- glow = glow-glow
- end
- end
- print "Place ladder instance in slot 15, Fuel in 16, and dirt/stone in 14. Torches go in 13."
- print "When only one ladder or filler is in their slots, program will look elsewhere."
- print "How deep do you want to mine? (z)"
- z = io.read()
- z = tonumber(z)
- print "Press any key to run."
- os.pullEvent("char")
- for i = 1,z do
- turtle.digDown()
- turtle.down()
- refuel()
- end
- moveForward()
- refuel()
- turtle.turnLeft()
- turtle.turnLeft()
- for i = 1,z do
- if not placeLadder() then
- --break
- end
- torch()
- selectDirt()
- turtle.placeDown()
- mineUp()
- refuel()
- glow = glow+1
- end
Add Comment
Please, Sign In to add comment