Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --entrer une direction et le nombre de fois qu'il le fera
- --Enter a direction and how many times repeat it...
- function move(String, nbr1)
- for d = 1, nbr1 do
- if String == 'f' then
- turtle.forward()
- elseif String == 'b' then
- turtle.back()
- elseif String == 'u' then
- turtle.up()
- elseif String == 'd' then
- turtle.down()
- end
- end
- end
- function turn(Dir)
- if Dir == 'l' then
- turtle.turnLeft()
- elseif Dir == 'r' then
- turtle.turnRight()
- end
- end
- while turtle.detect(log) do
- turtle.dig()
- print ("Found one log")
- end
- local x = 0
- turtle.select(1)
- turtle.refuel(2)
- turtle.select(2)
- turtle.refuel(10)
- turtle.select(1)
- turtle.dig()
- x = x + 1
- print(x .. " Buches recoltees ! ")
- move('f', 1)
- turtle.dig()
- x = x + 1
- print(x .. " Buches recoltees ! ")
- move('f', 1)
- turn('l')
- turtle.dig()
- x = x + 1
- print(x .. " Buches recoltees ! ")
- move('f', 1)
- turn('l')
- turtle.dig()
- x = x + 1
- print(x .. " Buches recoltees ! ")
- move('f', 1)
- turn('l')
- move('f', 1)
- turn('l')
- while true do
- if turtle.detectUp(log) == true then
- for i = 1, 4 do
- turtle.digUp()
- x = x + 1
- print(x .. " Buches recoltees ! ")
- move('f', 1)
- turn('l')
- end
- move('u', 1)
- else
- break
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement