Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --FjB3N2KX
- shell.run('clear')
- local Fuel = turtle.getFuelLevel()
- print("Current Fuel Level " ..Fuel)
- if Fuel<100 then
- turtle.refuel()
- else
- print("What do you want to do ?" ,"\n", "1.Tunnel", "\n", "2.Clear Space", "\n", "3.Defined Space")
- local answer = io.read()
- local counter=0
- local direction = 0
- local widthcount=0
- if answer=="1" then
- while Fuel>0 do
- turtle.dig()
- turtle.digUp()
- turtle.turnLeft()
- turtle.dig()
- turtle.up()
- turtle.dig()
- turtle.turnRight()
- turtle.turnRight()
- turtle.dig()
- turtle.down()
- turtle.dig()
- turtle.turnLeft()
- turtle.forward(1)
- Fuel = turtle.getFuelLevel()
- if Fuel<500 then
- turtle.refuel()
- else
- Fuel = turtle.getFuelLevel()
- end
- end
- else
- if answer=="2" then
- while Fuel>0 do
- turtle.dig()
- turtle.forward(1)
- turtle.turnLeft()
- turtle.dig()
- turtle.digUp()
- turtle.up()
- turtle.dig()
- turtle.digUp()
- turtle.up()
- turtle.dig()
- turtle.turnRight()
- turtle.turnRight()
- turtle.dig()
- turtle.down()
- turtle.dig()
- turtle.down()
- turtle.dig()
- turtle.turnLeft()
- Fuel = turtle.getFuelLevel()
- if Fuel<500 then
- turtle.refuel()
- else
- Fuel = turtle.getFuelLevel()
- end
- end
- else
- if answer=="3" then
- local countupheight = 0
- local countdownheight=0
- print("Enter length")
- local length = io.read()
- length = tonumber(length)
- print("Enter width")
- local width = io.read()
- width=tonumber(width)
- print("Enter height")
- local height = io.read()
- height=tonumber(height)
- if Fuel>0 then
- while counter<length do
- turtle.dig()
- while countupheight<height do
- turtle.digUp()
- turtle.up()
- countupheight = countupheight+1
- print("up" .. countupheight)
- end
- countdownheight=countupheight
- while countdownheight>0 do
- turtle.down()
- countdownheight=countdownheight-1
- print("down" .. countdownheight)
- end
- counter = counter+1
- countupheight=0
- countdownheight=0
- turtle.forward(1)
- if counter==length then
- if widthcount<width then
- if direction==0 then
- turtle.turnRight()
- turtle.dig()
- turtle.forward(1)
- turtle.turnRight()
- direction=1
- counter=0
- widthcount = widthcount+1
- else
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- direction=0
- counter=0
- widthcount = widthcount+1
- end
- end
- end
- end
- else
- Fuel = turtle.getFuelLevel()
- if Fuel<500 then
- turtle.refuel()
- else
- Fuel = turtle.getFuelLevel()
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement