Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local farmSideLength = 5
- local inspectAttempts = 5
- local desiredFuelPercent = 0.5
- local function forward()
- while not turtle.forward() do
- turtle.dig()
- end
- end
- local function checkDown(name)
- local i
- for i = 1, inspectAttempts do
- local success, blockData = turtle.inspectDown()
- if success then
- return blockData.name:find(name) ~= nil
- end
- end
- end
- while true do
- turtle.select(1)
- forward()
- forward()
- turtle.turnRight()
- turtle.placeDown()
- local i, j
- for i = 1, farmSideLength do
- for j = 2, farmSideLength do
- forward()
- turtle.placeDown()
- end
- if i < farmSideLength then
- if i % 2 == 1 then
- turtle.turnLeft()
- forward()
- turtle.placeDown()
- turtle.turnLeft()
- else
- turtle.turnRight()
- forward()
- turtle.placeDown()
- turtle.turnRight()
- end
- end
- end
- for i = 1, 2 do
- turtle.turnRight()
- for j = 2, farmSideLength do
- forward()
- end
- end
- forward()
- forward()
- if
- turtle.getFuelLevel() ~= 'unlimited' and checkDown('pedestal') and
- turtle.getFuelLevel() < turtle.getFuelLimit() * desiredFuelPercent
- then
- turtle.select(16)
- turtle.suckDown()
- turtle.refuel()
- end
- sleep(60)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement