What can be researched?
Posted: Mon Feb 05, 2018 8:47 pm
How to get this information? http://lua-api.factorio.com/latest/LuaTechnology.html
Code: Select all
local function get_tech_color(tech)
if tech.researched then
return 'green'
end
for _,pre in pairs(tech.prerequisites) do
if not tech.force.technologies[pre.name].researched then
return 'red'
end
end
return 'yellow'
end
local force = game.player.force --enter your force here
local color = {}
for _,tech in pairs(force.technologies) do
color[tech.name] = get_tech_color(tech)
end
print(serpent.block(color))