Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- long = 39
- larg = 6
- balance = 1
- fuel = 0
- coal = 0
- --- Fonctions ---
- function refuel()
- fuel = turtle.getFuelLevel()
- if fuel < 10 then
- turtle.refuel(2)
- end
- end
- function back()
- repeat
- turtle.forward()
- until turtle.detect()
- turtle.turnLeft()
- end
- function drop()
- turtle.select(2)
- turtle.dropDown()
- turtle.select(3)
- turtle.dropDown()
- end
- function recharge()
- turtle.select(1)
- coal = turtle.getItemCount(1)
- if coal == 0 then
- turtle.suckUp()
- end
- end
- function longueur()
- cache = long
- while cache ~= 0 do
- turtle.dig()
- turtle.forward()
- cache = cache - 1
- print(cache)
- end
- cache = long
- end
- function Turn()
- if balance < 0 then
- turtle.turnRight()
- turtle.forward()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- elseif balance > 0 then
- turtle.turnLeft()
- turtle.forward()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- end
- iFAjY7fz
- end
- --- Programme ---
- recharge()
- while larg ~= 0 do
- refuel()
- longueur()
- Turn()
- larg = larg - 1
- end
- repeat
- turtle.forward()
- until turtle.detect()
- turtle.turnRight()
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment