Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- local mf = 100
- local function checkSaps()
- if turtle.getItemCount(14) <= 1 then
- turtle.select(14)
- turtle.turnLeft()
- turtle.suck()
- turtle.turnRight()
- end
- end
- local function checkBone()
- if turtle.getItemCount(15) <= 1 then
- turtle.select(15)
- turtle.turnRight()
- turtle.suck()
- turtle.turnLeft()
- end
- end
- local function checkFuel()
- if turtle.getItemCount(13) <= 5 then
- turtle.select(13)
- turtle.turnRight()
- turtle.turnRight()
- turtle.suck()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- end
- local function refuel()
- if turtle.getFuelLevel() <= mf then
- turtle.select(13)
- turtle.refuel(1)
- end
- end
- local function back()
- while not turtle.detect() do
- turtle.down()
- end
- end
- local function cutTree()
- while turtle.detect(not turtle.compare(16)) do
- turtle.dig()
- turtle.digUp()
- turtle.up()
- end
- end
- local function check()
- if turtle.detect(turtle.compare(16)) then
- turtle.up()
- else
- cutTree()
- end
- end
- local function plantTree()
- if turtle.detect() then
- check()
- else
- turtle.select(14)
- turtle.place()
- turtle.select(15)
- turtle.place()
- end
- end
- local function dumpLoad()
- for i = 1,12 do
- if turtle.detect(turtle.compare(16)) then
- turtle.select(i)
- turtle.dropDown()
- else
- check()
- back()
- end
- end
- end
- local function run()
- checkSaps()
- checkBone()
- checkFuel()
- refuel()
- plantTree()
- cutTree()
- back()
- dumpLoad()
- check()
- end
- run()
- sleep(90)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement