Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ffunction refuel()
- while turtle.getItemCount(1) ~=0 and turtle.getFuelLevel() < 200 do
- turtle.select(1)
- turtle.refuel(1)
- end
- if turtle.getFuelLevel() == 0 and turtle.getItemCount(1) == 0 then
- return true
- else
- return false
- end
- end
- if turtle.getFuelLevel() then
- return("Out of Fuel")
- end
- function needFuel()
- if turtle.getFuelLevel() < 10 then
- return true
- else
- return false
- end
- end
- function digForward()
- while turtle.detect() do
- turtle.dig()
- end
- end
- function digUp()
- while turtle.detect() do
- digForward()
- print("Digging the block")
- turtle.up()
- print("Is this the Jeffersons? Cuz we movin' on up")
- end
- while not turtle.detect() and not turtle.detectDown() do
- turtle.down()
- print("Next stop, the basement!")
- end
- end
- function moveForward()
- if needFuel() then
- refuel()
- else
- print("Out of Fuel")
- end
- while turtle.forward() == false do
- digForward()
- turtle.attack()
- digUp()
- end
- end
- moveForward()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement