Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = peripheral.wrap("right")
- function statsToTable()
- seed = a.getSeedInAnalyzer()
- a.analyze()
- growth, gain, strength = a.getSpecimenStats()
- seedTable = {seed, growth, gain, strength}
- for key, value in pairs(seedTable) do
- print("key: "..key.." is "..value)
- end
- end
- function save(table,name)
- local file = fs.open(name,"w")
- file.write(textutils.serialize(table))
- file.close()
- end
- function load(name)
- local file = fs.open(name,"r")
- local data = file.readAll()
- file.close()
- print(data)
- checkTable = textutils.unserialize(data)
- for key, value in pairs(checkTable) do
- print("key: "..key.." is "..value)
- end
- end
- print()
- --while true dofile(
- statsToTable()
- save(seedTable, seedTable[1])
- if fs.exists(seedTable[1]) then
- print("jeej")
- print(data)
- end
- load(seedTable[1])
- --end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement