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 movingUp(lenght)
- local i = 0
- while i<lenght do
- if stepUp() then
- i = i+1
- end
- end
- end
- function movingDown(lenght)
- local i = 0
- while i<lenght do
- if stepDown() 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)
- local i=0
- while i<lenght do
- line(i%2,lenght)
- movingUp(1)
- i=i+1
- end
- line(i%2,lenght)
- if i%2 == 0 then
- line(1,lenght)
- end
- movingDown(lenght)
- moving(1)
- end
- function pose()
- turtle.select(1)
- turtle.place()
- local 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(turtle.getItemCount(3))
- turtle.select(2)
- turtle.dig()
- end
- while 1 do
- tunneling(19)
- turtle.turnLeft()
- turtle.turnLeft()
- pose()
- while turtle.getFuelLevel()<450 do
- refueling()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- end
Advertisement
Add Comment
Please, Sign In to add comment