Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = {...}
- local branchesToMine = tonumber(tArgs[1])
- local maximumMineableSlot = 15
- local torchSlot = 16
- if #tArgs < 1 then
- branchesToMine = 1
- print(" Defaulting to 1 branches to mine")
- end
- function fuel()
- while turtle.getFuelLevel() < 1000 do
- for i=1, 16 do
- turtle.select(i)
- turtle.refuel()
- end
- if turtle.getFuelLevel() < 1000 then
- write ("Please enter fuel manually")
- os.sleep(5)
- end
- end
- end
- function minebranch()
- for i = 1, 16 do
- fuel()
- turtle.dig()
- turtle.digUp()
- turtle.digDown()
- if i % 4 == 0 then
- turtle.select(torchSlot)
- turtle.placeDown()
- turtle.select(1)
- end
- turtle.turnLeft()
- turtle.dig()
- for i = 1, 2 do
- turtle.turnRight()
- end
- turtle.dig()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- end
- end
- function goBack()
- for i = 1, 2 do
- turtle.turnLeft()
- end
- for i = 1, 16 do
- fuel()
- while not turtle.forward() do
- turtle.dig()
- end
- end
- for i = 1, 2 do
- turtle.turnLeft()
- end
- end
- function nextBranch()
- turtle.turnRight()
- for i = 1, 5 do
- fuel()
- while not turtle.forward() do
- turtle.dig()
- end
- end
- turtle.turnLeft()
- end
- for i = 1, branchesToMine do
- minebranch()
- goBack()
- nextBranch()
- end
Advertisement
Add Comment
Please, Sign In to add comment