Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function step()
- turtle.dig()
- turtle.attack()
- return(turtle.forward())
- end
- function stepDown()
- turtle.digDown()
- turtle.attackDown()
- return(turtle.down())
- end
- function stepUp()
- turtle.digUp()
- turtle.attackUp()
- return(turtle.up())
- end
- function moving(lenght)
- local i = 0
- while i<lenght do
- if step() then
- i = i+1
- end
- end
- end
- function line(side,lenght)
- -- side est un nombre : 0 vers la droite, 1 vers la gauche
- if side == 0 then
- turtle.turnRight()
- moving(lenght)
- turtle.turnLeft()
- else
- turtle.turnLeft()
- moving(lenght)
- turtle.turnRight()
- end
- end
- function tunneling(lenght)
- i=0
- while i<lenght do
- line(i%2,lenght)
- stepUp()
- i=i+1
- end
- line(i%2,lenght)
- if i%2 == 0 then
- line(1,lenght)
- end
- i=0
- while i<lenght do
- stepDown()
- i=i+1
- end
- step()
- end
- function pose()
- turtle.select(1)
- turtle.place()
- i=2
- while i<16 do
- i=i+1
- turtle.select(i)
- turtle.drop()
- end
- turtle.select(1)
- turtle.dig()
- end
- function refueling()
- turtle.select(2)
- turtle.place()
- turtle.select(3)
- turtle.suck()
- turtle.refuel(6)
- turtle.select(2)
- turtle.dig()
- end
- while 1 do
- tunneling(19)
- turtle.turnLeft()
- turtle.turnLeft()
- pose()
- while turtle.getFuelLevel()<400 do
- refueling()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- end
Advertisement
Add Comment
Please, Sign In to add comment