Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- local farmed = 0
- local f = fs.open("save.lua", "r")
- if f then
- farmed = f.readAll()
- f.close()
- end
- local setLabel = function() os.setComputerLabel("§fFarmed: §6"..farmed) end
- local update = function()
- term.clear()
- term.setCursorPos(1,1)
- print("Coco Farm")
- print("Farmed: "..farmed)
- setLabel()
- end
- print("Tiny Coco Farm")
- print("z256")
- while true do
- update()
- while select(2, turtle.inspect()).state.age ~= 2 and select(2, turtle.inspectDown()).state.age ~= 2 do
- sleep(1)
- end
- if select(2, turtle.inspect()).state.age == 2 then
- turtle.dig()
- turtle.place()
- farmed = farmed + 1
- end
- if select(2, turtle.inspectDown()).state.age == 2 then
- turtle.digDown()
- turtle.placeDown()
- farmed = farmed + 1
- end
- turtle.dropUp()
- local f = fs.open("save.lua", "w")
- f.write(farmed)
- f.close()
- end
Advertisement
Add Comment
Please, Sign In to add comment