Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- branches = 4
- function refuel( ammount )
- return true
- end
- local function tryUp()
- if not refuel() then
- print( "Not enough Fuel" )
- end
- while not turtle.up() do
- if turtle.detectUp() then
- if turtle.digUp() then
- if not collect() then
- print( "Up OK" )
- end
- else
- return false
- end
- elseif turtle.attack() then
- if not collect() then
- end
- else
- sleep( 0.5 )
- end
- end
- return true
- end
- local function tryForwards()
- if not refuel() then
- print( "Not enough Fuel" )
- end
- while not turtle.forward() do
- if turtle.detect() then
- if turtle.dig() then
- if not collect() then
- end
- else
- return false
- end
- elseif turtle.attack() then
- if not collect() then
- end
- else
- sleep( 0.5 )
- end
- end
- return true
- end
- local function digbranch()
- shell.run("digtunnel",tArgs[1])
- tryUp()
- shell.run("digtunnel",tArgs[1])
- while turtle.down() do
- sleep(0.1)
- end
- end
- while branches > 0 do
- digbranch()
- turtle.turnRight()
- tryForwards()
- tryForwards()
- tryForwards()
- turtle.turnLeft()
- branches = branches - 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement