Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Init()
- pathed = 0
- turtle.digDown()
- turtle.down()
- turtle.digDown()
- turtle.down()
- end
- function Refuel()
- fuel = turtle.getFuelLevel()
- while fuel < 200 do
- print("Refueling...")
- turtle.select(1)
- turtle.refuel(1)
- fuel = turtle.getFuelLevel()
- end
- print("Turtle is done refueling")
- end
- function Mine()
- print("Mining")
- x = 15
- while x > 0 do
- turtle.digUp()
- turtle.digDown()
- if turtle.forward() == false then
- print("Path is obstructed. Probably gravel or sand. Clearing...")
- repeat
- turtle.digUp()
- turtle.dig()
- sleep(0.25) -- small sleep to allow for gravel/sand to fall.
- until turtle.forward() == true
- end
- x = x - 1
- end
- end
- function TurnAroundLeft()
- print("Turning Left")
- turtle.turnLeft()
- if turtle.forward() == false then
- print("Path is obstructed. Probably gravel or sand. Clearing...")
- repeat
- turtle.digUp()
- turtle.dig()
- turtle.digDown()
- sleep(0.25) -- small sleep to allow for gravel/sand to fall.
- until turtle.forward() == true
- end
- turtle.turnLeft()
- end
- function TurnAroundRight()
- print("Turning Right")
- turtle.turnRight()
- if turtle.forward() == false then
- print("Path is obstructed. Probably gravel or sand. Clearing...")
- repeat
- turtle.digUp()
- turtle.dig()
- turtle.digDown()
- sleep(0.25) -- small sleep to allow for gravel/sand to fall.
- until turtle.forward() == true
- end
- turtle.turnRight()
- end
- function PathtoChest()
- print("Going to the chest")
- move = 16
- turtle.turnRight()
- while move > 0 do
- if turtle.forward() == false then
- print("Path is obstructed. Probably gravel or sand. Clearing...")
- repeat
- turtle.digUp()
- turtle.dig()
- turtle.digDown()
- sleep(0.25) -- small sleep to allow for gravel/sand to fall.
- until turtle.forward() == true
- end
- move = move - 1
- end
- turtle.turnRight()
- move = 10
- while move > 0 do
- if turtle.forward() == false then
- print("Path is obstructed. Probably gravel or sand. Clearing...")
- repeat
- turtle.digUp()
- turtle.dig()
- turtle.digDown()
- sleep(0.25) -- small sleep to allow for gravel/sand to fall.
- until turtle.forward() == true
- end
- move = move - 1
- end
- pathedRes = pathed
- while pathed > 0 do
- turtle.up()
- turtle.up()
- turtle.up()
- pathed = pathed - 1
- end
- pathed = pathedRes
- pathed = pathed + 1
- pathedRes = pathed
- end
- function StoreItems()
- for inventory = 2, 16 do
- turtle.select(inventory)
- turtle.drop()
- end
- end
- function NextLvl()
- turtle.turnLeft()
- turtle.turnLeft()
- while pathed > 0 do
- turtle.digDown()
- turtle.down()
- turtle.digDown()
- turtle.down()
- turtle.digDown()
- turtle.down()
- pathed = pathed - 1
- end
- pathed = pathedRes
- end
- Refuel()
- Init()
- loopLvl = 8
- loopMine = 10
- loopMineRes = loopMine
- while loopLvl > 0 do
- Refuel()
- Mine()
- while loopMine > 0 do
- Refuel()
- TurnAroundLeft()
- Mine()
- TurnAroundRight()
- Mine()
- loopMine = loopMine - 1
- end
- loopMine = loopMineRes
- PathtoChest()
- StoreItems()
- NextLvl()
- loopLvl = loopLvl - 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement