Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local length = 61
- local width = 61
- local function refuel()
- if turtle.getFuelLevel() < 50 then
- local prev = turtle.getSelectedSlot()
- turtle.select(1)
- if not turtle.refuel(4) then
- print('Need more fuel')
- while not turtle.refuel(4) do
- sleep(3)
- end
- end
- turtle.select(prev)
- end
- end
- local function tryForwards()
- refuel()
- while not turtle.forward() do
- if turtle.detect() then
- turtle.dig()
- sleep(.5)
- while turtle.detect() do
- turtle.dig()
- sleep(.5)
- end
- elseif turtle.attack() then
- else
- sleep(1)
- end
- end
- end
- local function turnAround(i)
- turtle.placeDown()
- if i%2 == 1 then
- turtle.turnRight()
- tryForwards()
- turtle.turnRight()
- else
- turtle.turnLeft()
- tryForwards()
- turtle.turnLeft()
- end
- end
- turtle.select(2)
- for i = 1, length-1, 1 do
- for j = 1, width-1, 1 do
- refuel()
- tryForwards()
- end
- turnAround(i)
- end
Advertisement
Add Comment
Please, Sign In to add comment