Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function checkFuel()
- turtle.select(1)
- while turtle.getFuelLevel() < 100 do
- turtle.refuel(1)
- end
- end
- local function forwardcheck()
- checkFuel()
- while not turtle.forward() do
- turtle.dig()
- end
- end
- local function startime()
- term.clear()
- print("Welcome to MinerBot2.0\n\n")
- print("Please place me to the left side of your new tunnel one block up facting the wall.\n\n")
- print("Place fuel in slot 1 and a chest in slot 2.")
- print("Enter the width you want your new tunnel... ")
- wth = tonumber(read())
- print("Enter the lenght you want your new tunel... ")
- lgh = tonumber(read())
- print("Number of offset block to right, enter 0 to end at same square as start... ")
- offSet = tonumber(read())
- print("Number of shafts to dig...")
- shaftNumber = tonumber(read())
- end
- local function mineLeft()
- local x = wth - 1
- turtle.dig()
- forwardcheck()
- turtle.digUp()
- turtle.digDown()
- turtle.turnRight()
- for i=1,x do
- turtle.dig()
- forwardcheck()
- turtle.digUp()
- turtle.digDown()
- end
- turtle.turnLeft()
- wSide = not wSide
- end
- local function mineRight()
- local x = wth - 1
- turtle.dig()
- forwardcheck()
- turtle.digUp()
- turtle.digDown()
- turtle.turnLeft()
- for i=1,x do
- turtle.dig()
- forwardcheck()
- turtle.digUp()
- turtle.digDown()
- end
- turtle.turnRight()
- wSide = not wSide
- end
- local function goHome()
- if wSide then
- turtle.turnRight()
- turtle.turnRight()
- for i=1,lgh do
- forwardcheck()
- end
- else
- turtle.turnLeft()
- for i=1,(wth-1) do
- forwardcheck()
- end
- turtle.turnLeft()
- for i=1,lgh do
- forwardcheck()
- end
- end
- turtle.turnRight()
- turtle.turnRight()
- end
- local function offSetF()
- turtle.turnRight()
- for i=1,offSet do
- forwardcheck()
- end
- turtle.turnLeft()
- end
- local function digTime()
- for i=1,lgh do
- if wSide then
- mineLeft()
- else
- mineRight()
- end
- end
- end
- local function placeItems()
- turtle.digDown()
- turtle.select(2)
- turtle.placeDown()
- for x=3,16 do
- turtle.select(x)
- turtle.dropDown()
- end
- end
- startime()
- for t=1,shaftNumber do
- wSide = true
- digTime()
- goHome()
- placeItems()
- offSetF()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement