Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - local fuelfail = 0
 - local matfail = 0
 - local movefail = 0
 - local startfail = 1
 - local matstart = 1
 - local function collision()
 - print("I ran into something.")
 - error()
 - end
 - local function refuel()
 - if turtle.getFuelLevel() < 10 then
 - fuelfail = 0 else
 - turtle.select(15)
 - if not turtle.place() then
 - collision()
 - end
 - turtle.suck(5)
 - turtle.refuel()
 - turtle.dig()
 - turtle.select(1)
 - fuelfail = fuelfail+1
 - if fuelfail > 1 then
 - print("I ran out of fuel.")
 - error()
 - else
 - return refuel()
 - end
 - end
 - end
 - local function material()
 - turtle.select(1)
 - if turtle.compareTo(14) then
 - else
 - turtle.drop()
 - end
 - while turtle.getItemCount() == 0 do
 - turtle.select(16)
 - if not turtle.place() then
 - collision()
 - end
 - turtle.select(1)
 - turtle.suck()
 - turtle.select(16)
 - turtle.dig()
 - turtle.select(1)
 - if not turtle.compareTo(14) and matstart == 1 then
 - print("The material enderchest is not")
 - print("providing the right thing,")
 - print("please check it's position in the inventory.")
 - error()
 - else
 - matstart = 0
 - end
 - matfail = matfail+1
 - if matfail > 1 then
 - print("I ran out of material.")
 - error()
 - else
 - end
 - end
 - matfail = 0
 - end
 - local function advDig()
 - while turtle.detect() do
 - turtle.dig()
 - if turtle.detect() then
 - os.sleep(0.8)
 - end
 - end
 - end
 - while true do
 - advDig()
 - refuel()
 - material()
 - turtle.select(1)
 - if not turtle.forward() then
 - collision()
 - end
 - if turtle.detectDown() and startfail == 1 then
 - print("I think I started in the wrong spot, ")
 - print("please place me in a")
 - print("valid starting position.")
 - error()
 - end
 - if startfail == 1 then
 - startfail = 0
 - end
 - if turtle.detectDown() then
 - movefail = movefail+1
 - if movefail > 1 then
 - print("I think I am done.")
 - error()
 - else turtle.back()
 - turtle.turnRight()
 - end
 - else
 - movefail = 0
 - turtle.placeDown()
 - end
 - end
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment