Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Slot 1: Ender Chest to dumps items into.
- --Slot 2: Fuel
- --Variables:
- A = 0
- B = 0
- C = 0
- --Functions
- --refuel
- local function refuel()
- if turtle.getFuelLevel() < 40 then
- turtle.select(2)
- turtle.refuel(10)
- end
- end
- --Put Items in Ender Chest
- local function dumptochest()
- if turtle.getItemCount(16) ~= 0 then
- turtle.digDown()
- turtle.select(1)
- turtle.placeDown()
- for i = 3,16 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.select(1)
- turtle.digDown()
- end
- end
- -- Mines
- local function mining()
- refuel()
- turtle.dig()
- local f = turtle.forward()
- if f then
- A = A + 1
- end
- turtle.digUp()
- turtle.digDown()
- sleep(0.2)
- end
- --Returns Home
- local function gohome()
- refuel()
- turtle.dig()
- local f = turtle.forward()
- if f then
- A = A + 1
- sleep(0.3)
- end
- end
- -- Code
- if C == 0 then
- write("How Long do you want your tunnels?")
- distance = io.read()
- distance = tonumber(distance)
- end
- while A < distance do
- dumptochest()
- mining()
- end
- turtle.turnLeft()
- mining()
- turtle.turnLeft()
- A = 0
- while A < distance do
- dumptochest()
- mining()
- end
- turtle.turnRight()
- mining()
- turtle.turnRight()
- A = 0
- while A < distance do
- dumptochest()
- mining()
- end
- turtle.turnLeft()
- mining()
- turtle.turnLeft()
- A = 0
- while A < distance do
- dumptochest()
- mining()
- end
Add Comment
Please, Sign In to add comment