Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fuelCheck()
- local fuelLevel = turtle.getFuelLevel()
- if fuelLevel < 100 then
- turtle.select(1)
- turtle.refuel(2)
- print("Refueled.")
- end
- end
- function isLog()
- local success, data = turtle.inspect()
- if data.name == "minecraft:log" then
- return true
- else
- return false
- end
- end
- function isSap()
- local success, data = turtle.inspect()
- if data.name == "minecraft:sapling" then
- return true
- else
- return false
- end
- end
- function plantTree()
- turtle.turnLeft()
- turtle.select(3)
- turtle.place()
- turtle.turnRight()
- turtle.select(1)
- end
- function clean()
- turtle.suckUp()
- turtle.suck()
- turtle.turnLeft()
- turtle.suck()
- turtle.turnLeft()
- turtle.suck()
- turtle.turnLeft()
- turtle.suck()
- turtle.turnLeft()
- turtle.suck()
- end
- function mF()
- clean()
- turtle.forward()
- end
- function mB()
- clean()
- turtle.turnLeft()
- turtle.turnLeft()
- clean()
- turtle.forward()
- clean()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- function chop()
- turtle.turnLeft()
- if isLog() then
- turtle.dig()
- turtle.select(3)
- turtle.place()
- else
- if isSap() then
- else
- turtle.select(3)
- turtle.place()
- end
- end
- clean()
- turtle.turnRight()
- clean()
- end
- function check()
- for i = 1, 5 do
- fuelCheck()
- for i = 1, 10 do
- mF()
- end
- turtle.turnRight()
- mF()
- turtle.turnRight()
- for i = 1, 5 do
- chop()
- mF()
- mF()
- end
- mF()
- turtle.turnLeft()
- mF()
- mF()
- turtle.turnLeft()
- mF()
- end
- end
- local chopping = true
- while chopping do
- check()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement