mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 07:04:52 +09:00
# Conflicts: # sharedPlugins/researchSync/dumpResearch.lua # sharedPlugins/researchSync/index.js
25 lines
703 B
Lua
25 lines
703 B
Lua
|
|
local data = {};
|
|
local force = game.forces["player"];
|
|
|
|
for _, tech in pairs(force.technologies) do
|
|
local progress;
|
|
if tech == force.current_research then
|
|
progress = force.research_progress
|
|
else
|
|
progress = force.get_saved_technology_progress(tech.name);
|
|
end
|
|
local infinite = tech.enabled == true and tech.prototype.max_level == 4294967295;
|
|
local tech_data = {
|
|
tech.name,
|
|
tostring(tech.researched),
|
|
tostring(tech.level),
|
|
tostring(progress),
|
|
tostring(infinite),
|
|
}
|
|
tech_data = table.concat(tech_data, ':')
|
|
table.insert(data, tech_data);
|
|
end
|
|
|
|
game.write_file("researchSync.txt", table.concat(data, "\n"), false, 0)
|