-- Unlock rare metal technologies if the player has already mined rare metals. for _, force in pairs(game.forces) do for _, surface in pairs(game.surfaces) do local item_stats = force.get_item_production_statistics(surface) if item_stats.get_output_count("kr-rare-metal-ore") > 0 then force.technologies["kr-rare-metal-mining"].researched = true force.technologies["kr-rare-metal-processing"].researched = true break end end end