Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- function refuel()
- if turtle.getFuelLevel() < 50 then
- turtle.select(16)
- turtle.placeUp()
- turtle.suckUp()
- turtle.refuel()
- turtle.dropUp()
- turtle.digUp()
- turtle.select(1)
- end
- end
- function refill()
- if turtle.getItemCount(1) == 0 then
- turtle.select(15)
- turtle.placeUp()
- turtle.select(1)
- turtle.suckUp()
- turtle.select(15)
- turtle.digUp()
- turtle.select(1)
- end
- end
- function (testground)
- if turtle.detectDown() == false then
- turtle.placeDown()
- end
- if turtle.detectDown() == true then
- andarfrente()
- end
- function testsides()
- turtle.turnLeft()
- if turtle.detect() == true then
- turtle.turnRight()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- testground()
- end
- turtle.turnRight()
- if turtle.detect() == true then
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- testground()
- end
- end
- function andarfrente()
- if turtle.detect() == false then
- turtle.forward()
- end
- if turtle.detect() == true then
- testsides()
- end
- end
- function andar()
- if turtle.getItemCount(1) > 0 then
- refuel()
- testground()
- end
- end
- refuel()
- refill()
- andar()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement