Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local fuelSlot = 1
- local depth = 190
- local width = 150
- local height = 9
- local success = false
- function checkFuel(slot)
- while turtle.getFuelLevel() == 0 do
- turtle.select(fuelSlot)
- if turtle.getItemCount(fuelSlot) == 0 then
- fuelSlot = fuelSlot + 1
- end
- if fuelSlot == 16 then
- term.clear()
- print("Fuel slot ("..fuelSlot..") is empty....")
- print("Insert Fuel and")
- print("Press any key to continue...")
- os.pullEvent("key")
- fuelSlot = 1
- end
- turtle.refuel(1)
- end
- term.clear()
- print("Fuel OK!")
- end
- function digForward(distance)
- for i = 1, distance, 1 do
- turtle.dig()
- checkFuel(fuelSlot)
- while turtle.forward() == false do
- term.clear()
- print("Clear obstruction...")
- turtle.dig()
- end
- turtle.turnRight()
- turtle.select(16)
- turtle.place()
- turtle.turnLeft()
- end
- end
- function moveBack(distance)
- for i = 1, distance, 1 do
- checkFuel(fuelSlot)
- if turtle.back() == false then
- term.clear()
- print("Clear obstruction...")
- turtle.turnRight()
- turtle.turnRight()
- digForward(1)
- turtle.turnRight()
- turtle.turnRight()
- end
- end
- end
- function moveUp(distance)
- for i = 1, distance, 1 do
- checkFuel(fuelSlot)
- while turtle.up() == false do
- term.clear()
- print("Clear obstruction...")
- turtle.digUp()
- end
- end
- end
- function moveDown(distance)
- for i = 1, distance, 1 do
- checkFuel(fuelSlot)
- while turtle.down() == false do
- term.clear()
- print("Clear obstruction...")
- turtle.digDown()
- end
- end
- end
- --start program
- for a = 1, width, 1 do
- for b = 1, height, 1 do
- digForward(depth+1)
- term.clear()
- print(a * 100 / width .. "% Complete...")
- moveBack(depth+1)
- moveUp(1)
- end
- moveDown(height)
- turtle.turnRight()
- digForward(1)
- turtle.turnLeft()
- term.clear()
- print(a * 100 / width .. "% Complete...")
- end
- turtle.turnLeft()
- digForward(width)
- turtle.turnRight()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement