Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("hawks cool ass automatic tree farm")
- turtle.select(8)
- turtle.refuel()
- local chopped = 0
- if fs.exists("amount") then
- local filer = fs.open("amount","r")
- chopped = tonumber((filer.readAll() or "") or "0")
- filer.close()
- end
- chopped = chopped or 0
- while true do
- turtle.select(3) -- sappling
- turtle.place()
- turtle.select(2) -- log
- local i = 0
- while not turtle.compare() do
- os.sleep(1)
- i = i + 1
- if i>10 then
- print("Fuel: "..turtle.getFuelLevel())
- print("Trees Chopped: "..chopped)
- i = 0
- end
- end
- local y = 0
- while turtle.compare() do
- turtle.dig()
- turtle.digUp()
- turtle.up()
- y = y + 1
- end
- for i=1,y do turtle.down() end
- chopped = chopped + 1
- local filew = fs.open("amount","w")
- filew.write(tostring(chopped))
- filew.close()
- turtle.select(8)
- turtle.refuel()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement