Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shell.run('clear')
- local Fuel = turtle.getFuelLevel()
- print("Current Fuel Level " ..Fuel)
- local counter=0
- local direction = 0
- local widthcount=0
- local countupheight = 0
- local countdownheight=0
- local backhome=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
- turtle.forward()
- while counter<length do
- Fuel = turtle.getFuelLevel()
- print("Fuel is " .. Fuel)
- while countdownheight<height do
- turtle.refuel()
- turtle.placeDown(1)
- turtle.refuel()
- turtle.down()
- countdownheight = countdownheight+1
- end
- countupheight=countdownheight
- while countupheight>0 do
- turtle.up()
- countupheight=countupheight-1
- 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.forward(1)
- turtle.turnRight()
- direction=1
- counter=0
- widthcount = widthcount+1
- else
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- direction=0
- counter=0
- widthcount = widthcount+1
- end
- end
- end
- end
- turtle.forward()
- turtle.turnRight()
- while backhome<width do
- turtle.forward()
- backhome=backhome+1
- end
- else
- Fuel = turtle.getFuelLevel()
- if Fuel<500 then
- turtle.refuel()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement