Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - turtle.select(1)
 - local fd = 0
 - local length = tonumber(60)
 - local height = tonumber(12)
 - local currentSlot = tonumber(1)
 - local torch = 0
 - local function Refill()
 - for i = 1,4 do
 - if turtle.getItemSpace(i) ~= 0 then
 - for j = 5,15 do
 - turtle.select(j)
 - if turtle.compareTo(i) then
 - turtle.transferTo(i)
 - end
 - end
 - end
 - end
 - currentSlot = 1
 - turtle.select(currentSlot)
 - end
 - local function Unload()
 - for i = 5,15 do
 - turtle.select(i)
 - if turtle.getItemCount(i) > 0 then
 - turtle.drop()
 - end
 - end
 - currentSlot = 1
 - turtle.select(currentSlot)
 - end
 - local function gotoNextSlotIfEmpty()
 - while turtle.getItemCount(currentSlot) < 2 do
 - currentSlot = currentSlot + 1
 - turtle.select(currentSlot)
 - end
 - if currentSlot == 16 then
 - shell.exit()
 - end
 - end
 - local function PlaceBlock()
 - gotoNextSlotIfEmpty()
 - if turtle.compare() == false then
 - if turtle.place() == false then
 - repeat
 - turtle.attack()
 - gotoNextSlotIfEmpty()
 - if turtle.detect() == true then
 - if turtle.dig() == false then
 - -- found obsidian
 - return
 - end
 - end
 - until turtle.place() == true
 - end
 - end
 - end
 - local function PlaceBlockUp()
 - gotoNextSlotIfEmpty()
 - if turtle.compareUp() == false then
 - if turtle.placeUp() == false then
 - turtle.attackUp()
 - repeat
 - gotoNextSlotIfEmpty()
 - if turtle.detectUp() == true then
 - if turtle.digUp() == false then
 - -- found obsidian
 - return
 - end
 - end
 - until turtle.placeUp() == true
 - end
 - end
 - end
 - local function PlaceBlockDown()
 - gotoNextSlotIfEmpty()
 - if turtle.compareDown() == false then
 - if turtle.placeDown() == false then
 - turtle.attackDown()
 - repeat
 - gotoNextSlotIfEmpty()
 - if turtle.detectDown() == true then
 - if turtle.digDown() == false then
 - -- found obsidian
 - return
 - end
 - end
 - until turtle.placeDown() == true
 - end
 - end
 - end
 - local function NewDigUp()
 - if turtle.detectUp() then
 - turtle.digUp()
 - end
 - end
 - local function NewDig()
 - if turtle.detect() then
 - turtle.dig()
 - end
 - end
 - local function NewDigDown()
 - if turtle.detectDown() then
 - turtle.digDown()
 - end
 - end
 - local function tryUp()
 - while not turtle.up() do
 - if turtle.detectUp() then
 - turtle.digUp()
 - else
 - turtle.attackUp()
 - end
 - end
 - end
 - local function tryDown()
 - while not turtle.down() do
 - if turtle.detectDown() then
 - turtle.digDown()
 - else
 - turtle.attackDown()
 - end
 - end
 - end
 - local function tryForward()
 - while not turtle.forward() do
 - if turtle.detect() then
 - turtle.dig()
 - else
 - turtle.attack()
 - end
 - end
 - fd = fd + 1
 - end
 - local function tryForward2()
 - while not turtle.forward() do
 - if turtle.detect() then
 - turtle.dig()
 - else
 - turtle.attack()
 - end
 - end
 - end
 - local function BlockSides()
 - turtle.turnLeft()
 - PlaceBlock()
 - turtle.turnRight()
 - PlaceBlock()
 - turtle.turnRight()
 - PlaceBlock()
 - turtle.turnLeft()
 - end
 - local function GoBack()
 - for zzz = 1,fd do
 - tryForward2()
 - end
 - end
 - local function ReturnToBox()
 - turtle.turnLeft()
 - turtle.turnLeft()
 - for zzz = 1,fd do
 - tryForward2()
 - end
 - Refill()
 - Unload()
 - turtle.turnRight()
 - turtle.turnRight()
 - GoBack()
 - end
 - local function KillIt()
 - NewDigDown()
 - if turtle.down() then
 - PlaceBlockUp()
 - BlockSides()
 - tryUp()
 - PlaceBlockDown()
 - end
 - for u = 1,height do
 - BlockSides()
 - tryUp()
 - end
 - BlockSides()
 - tryDown()
 - PlaceBlockUp()
 - tryForward()
 - PlaceBlock()
 - tryUp()
 - BlockSides()
 - tryDown()
 - PlaceBlockUp()
 - for u = 1,height-1 do
 - BlockSides()
 - tryDown()
 - end
 - BlockSides()
 - NewDigDown()
 - if turtle.down() then
 - BlockSides()
 - tryUp()
 - PlaceBlockDown()
 - end
 - if turtle.getItemCount(14) > 0 then
 - ReturnToBox()
 - end
 - end
 - local function RunSpecial()
 - NewDigDown()
 - if turtle.down() then
 - PlaceBlockUp()
 - BlockSides()
 - tryUp()
 - PlaceBlockDown()
 - end
 - for u = 1,height do
 - BlockSides()
 - if u > 4 then
 - turtle.turnLeft()
 - turtle.turnLeft()
 - PlaceBlock()
 - turtle.turnLeft()
 - turtle.turnLeft()
 - end
 - tryUp()
 - end
 - BlockSides()
 - turtle.turnLeft()
 - turtle.turnLeft()
 - PlaceBlock()
 - turtle.turnLeft()
 - turtle.turnLeft()
 - tryDown()
 - PlaceBlockUp()
 - tryForward()
 - PlaceBlock()
 - tryUp()
 - BlockSides()
 - tryDown()
 - PlaceBlockUp()
 - for u = 1,height-1 do
 - BlockSides()
 - tryDown()
 - end
 - BlockSides()
 - NewDigDown()
 - if turtle.down() then
 - BlockSides()
 - tryUp()
 - PlaceBlockDown()
 - end
 - if turtle.getItemCount(14) > 0 then
 - ReturnToBox()
 - end
 - end
 - --- start
 - turtle.select(currentSlot)
 - PlaceBlockUp()
 - tryForward()
 - RunSpecial()
 - tryForward()
 - for i = 1,length-2 do
 - print (" Working on row # ", i)
 - KillIt()
 - tryForward()
 - end
 - --- final
 - KillIt()
 - -- come back
 - turtle.select(16)
 - turtle.turnLeft()
 - turtle.turnLeft()
 - tryUp()
 - for i = 1,119 do
 - tryForward()
 - if i == 1 then
 - tryForward()
 - PlaceBlockDown()
 - end
 - torch = torch + 1
 - if torch > 6 then
 - PlaceBlockDown()
 - torch = 0
 - end
 - end
 - tryDown()
 - turtle.turnLeft()
 - turtle.turnLeft()
 - turtle.select(1)
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment