Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Start
- term.write("Insert length: ")
- steps = tonumber(read())
- print(" ")
- term.write("Insert width: ")
- width = tonumber(read())
- print(" ")
- -- Important stuff
- steps = steps or 1
- width = width or 0
- local second = 0
- local fuelslot = 1
- local torchslot = 2
- local chestslot = 3
- local dirtslot = 4
- local torch = 0
- local chest = 0
- local fuellevel = turtle.getFuelLevel()
- -- function DIGBLOCK
- function digBlock()
- repeat
- turtle.dig()
- sleep(0.5)
- until not turtle.detect() == true
- end
- -- Required
- function refuel()
- if turtle.getFuelLevel() < 800 then
- turtle.select(1)
- repeat
- turtle.refuel(1)
- sleep(0.5)
- until turtle.getFuelLevel() > 1600
- turtle.select(5)
- end
- end
- function Chestre()
- if turtle.getItemCount(chestslot) < 2 then
- turtle.select(chestslot)
- repeat
- turtle.getItemCount(chestslot)
- sleep(0.5)
- until turtle.getItemCount(chestslot) >= 10
- turtle.select(5)
- end
- end
- function Torchre()
- if turtle.getItemCount(torchslot) < 2 then
- turtle.select(torchslot)
- repeat
- turtle.getItemCount(torchslot)
- sleep(0.5)
- until turtle.getItemCount(torchslot) >= 20
- turtle.select(5)
- end
- end
- -- Begin Digging
- print("Lets GO!")
- repeat
- refuel()
- Chestre()
- Torchre()
- turtle.placeDown()
- repeat
- turtle.digUp()
- sleep(0.3)
- until turtle.up() == true
- repeat
- turtle.digUp()
- sleep(0.3)
- until turtle.up() == true
- turtle.turnLeft()
- turtle.dig()
- turtle.turnRight()
- turtle.turnRight()
- turtle.dig()
- turtle.down()
- turtle.dig()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.dig()
- turtle.down()
- digBlock()
- turtle.turnRight()
- turtle.turnRight()
- digBlock()
- turtle.turnLeft()
- for i = 1, steps do
- refuel()
- Chestre()
- Torchre()
- digBlock()
- turtle.forward()
- turtle.select(dirtslot)
- turtle.placeDown()
- repeat
- turtle.digUp()
- sleep(0.3)
- until turtle.up() == true
- repeat
- turtle.digUp()
- sleep(0.3)
- until turtle.up() == true
- turtle.turnLeft()
- turtle.dig()
- turtle.turnRight()
- turtle.turnRight()
- turtle.dig()
- turtle.down()
- turtle.dig()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.dig()
- turtle.down()
- digBlock()
- turtle.turnRight()
- turtle.turnRight()
- digBlock()
- turtle.turnLeft()
- torch = torch + 1
- if torch == 10 then
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.select(torchslot)
- turtle.place()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.select(5)
- torch = 0
- end
- chest = chest + 1
- if chest == 30 then
- turtle.turnLeft()
- turtle.select(chestslot)
- turtle.place()
- for q=5,16 do turtle.select(q) turtle.drop() end
- turtle.turnRight()
- turtle.select(5)
- chest = 0
- end
- -- Return
- end
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.up()
- for i = 1, steps do
- turtle.forward()
- end
- -- With
- if width >= 1 then
- turtle.turnLeft()
- turtle.digDown()
- turtle.down()
- refuel()
- digBlock()
- turtle.forward()
- turtle.select(4)
- turtle.placeDown()
- digBlock()
- turtle.forward()
- digBlock()
- turtle.forward()
- turtle.turnLeft()
- width = width - 1
- end
- until width == 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement