Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not fs.exists("/cfg.lua") then local f = fs.open("cfg.lua", "w") f.close() end
- local f = fs.open("cfg.lua","r")
- if f then t = textutils.unserialize(f.readAll()) f.close() end
- if not t then t = {} end
- if not t.mined then t.mined = 0 end
- term.clear()
- while true do
- term.setCursorPos(1,1)
- print("Pumpkins Harvested: "..t.mined)
- local r,i = turtle.inspect()
- if r then
- if i.name == "minecraft:pumpkin" then
- turtle.dig()
- t.mined = t.mined + 1
- local f = fs.open("cfg.lua", "w")
- f.write(textutils.serialize(t)) f.close()
- turtle.dropDown()
- end
- end
- turtle.turnRight()
- sleep(.2)
- end
Advertisement
Add Comment
Please, Sign In to add comment