Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- if #tArgs ~= 3 then
- print( "Uso: down <largo> <ancho> <profundidad>" )
- return
- end
- local largo = tonumber( tArgs[1] )
- local ancho = tonumber( tArgs[2] )
- local profundidad = tonumber( tArgs[3] )
- local pos = 1
- local count = 0
- function checkFuel()
- if turtle.getFuelLevel() < 20 then
- turtle.select(1)
- turtle.refuel(1)
- print("Refuelling")
- else
- print("No fuel necessary")
- end
- end
- function start()
- turtle.digDown()
- turtle.down()
- end
- function forward()
- while turtle.forward() == false do
- turtle.dig()
- turtle.attack()
- sleep(0.25)
- end
- end
- function avanzar()
- for i=0,largo do
- turtle.dig()
- forward()
- end
- end
- function torcer()
- if count == 3 then
- count = 0
- else
- if pos == 1 then
- turtle.turnLeft()
- forward()
- turtle.turnLeft()
- pos = 0
- else
- turtle.turnRight()
- forward()
- turtle.turnRight()
- pos = 1
- end
- end
- end
- start()
- for i=0,3 do
- for i=0,ancho do
- avanzar()
- end
- torcer()
- count = count + 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement