Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Loading Robust Turtle API...")
- local load = os.loadAPI("t")
- if load then
- print("Robust Turtle API loaded.")
- else
- print("Robust Turtle API not found in the root directory with filename t")
- print("Attempting to download as t from pastebin...")
- os.sleep(2)
- local response = http.get("http://pastebin.com/raw.php?i= e0UksEtT")
- if response then
- print("Great Success.")
- local data = response.readAll()
- response.close()
- local file = fs.open("t", "w")
- file.write(data)
- file.close()
- print("Downloaded as t")
- load = os.loadAPI("t")
- if load then
- print("Robust Turtle API installed & loaded.")
- end
- else
- print( "Download Failed. Please Install Manually." )
- return
- end
- end
- --Strip Mining/Branch Mining Turtle. Digs a staircase down a user specified depth,
- --then digs pairs of tunnels one wide and 5 high.
- --turtle places toches every 6 blocks and a floor when there isnt one.
- --More efficient than quarrying or excavating with fall hazards
- local torch, stone = {1,3},{4,5}
- function stonedrop()
- for i=6,16 do --keeps two stacks of cobblestone
- turtle.select(i)
- if turtle.compareTo(stone[1]) then
- t.right()
- t.dig()
- turtle.drop()
- t.left()
- end
- end
- end
- function tunnel(dist)
- local breadcrumb=0
- --digs a 2 high one wide tunnel, placing down blocks
- --if there is no floor
- for i=1, dist do
- if t.forward() then
- breadcrumb = breadcrumb+1
- end
- t.digUp()
- if not turtle.detectDown() then
- t.placeDown(stone[1],stone[2])
- end
- end
- --prepare to dig top part of tunnel
- t.up(3)
- t.digUp()
- t.turnAround()
- local torchcount =5
- --digs a 3 high 1 wide tunnel on top resulting in a 5 high one wide tunnel.
- for i=1, breadcrumb do
- t.forward()
- t.digUp()
- t.digDown()
- torchcount = torchcount+1
- if torchcount == 6 then
- while not t.placeLeft(torch[1],torch[2]) do
- t.down()
- t.placeLeft(stone[1],stone[2])
- t.up()
- end--endwhile
- torchcount = 0
- end--end if
- end--end for
- t.down(3)
- end-- function tunnel
- function stairs(d)
- local torchcount =0
- for i=1, d do
- t.forward()
- t.digUp()
- t.down()
- if not turtle.detectDown() then
- t.placeDown(t.restack(stone[1],stone[2]))
- end
- torchcount = torchcount+1
- if torchcount == 6 then
- while not t.placeRight(t.restack(torch[1],torch[2])) do
- t.down()
- t.placeRight(t.restack(stone[1],stone[2]))
- t.up()
- end--endwhile
- torchcount = 0
- end--end if
- end--end while
- end--end function stairs
- term.clear()
- term.setCursorPos(1,1)
- print(tostring(os.getComputerLabel())..[=[ will dig a staircase and then dig branch tunnels to the left & right.
- ]=]..tostring(os.getComputerLabel())..[=[ will return to the bottom of the stairs after mining, not the top.]=])
- print([=[Torches are placed on the right for finding your way back easily. If ]=]..os.getComputerLabel()..[=[ does not detect a floor, ]=]..tostring(os.getComputerLabel())..[=[ will place cobblestone.]=])
- read()
- term.clear()
- term.setCursorPos(1,1)
- print([==[If digging more than 15 blocks deep, ]==]..tostring(os.getComputerLabel())..[=[ will turn around and dig the branch mine under the staircase to avoid unloaded chunks.]=])
- read()
- term.clear()
- term.setCursorPos(1,1)
- print("Place torches in slots 1-3, cobblestone in slots 4&5 and spare fuel in slot 16.")
- print("How deep should "..tostring(os.getComputerLabel()).." dig before digging the branch tunnels?")
- local depth = term.readNum()
- print("How long should each branch be?")
- local length = term.readNum()--branch length
- print("How many pairs of branches?")
- local branch = term.readNum()--branch quantity
- print(tostring(os.getComputerLabel()).."'s fuel level is "..turtle.getFuelLevel()..", ok?")
- read()
- local hall = 0
- stairs(depth)
- if depth > 15 then
- t.right()
- t.forward()
- t.digUp()
- t.right()
- for i=1,6 do
- if t.forward() then
- hall=hall+1
- end
- if i == 4 then
- while not t.placeRight(torch[1],torch[2]) do
- t.down()
- t.placeRight(stone[1],stone[2])
- t.up()
- end--endwhile
- end
- t.digUp()
- if not turtle.detectDown() then
- t.placeDown(stone[1],stone[2])
- end
- end
- end
- for i=1, branch do
- t.left()
- tunnel(length)
- tunnel(length)
- t.right()
- for i=1,3 do
- if i==2 then
- stonedrop()
- end
- if t.forward() then
- hall=hall+1
- end
- t.digUp()
- if not turtle.detectDown() then
- t.placeDown(stone[1],stone[2])
- end
- end
- print(i.." pairs of branches mined.")
- end
- t.back(hall)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement