command to summarise ore deposits

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
TheRaph
Fast Inserter
Fast Inserter
Posts: 226
Joined: Sun Sep 24, 2017 6:31 pm
Contact:

command to summarise ore deposits

Post by TheRaph »

Is there any command to summarise the amounts (sorted by type) of all ore deposits of entire revealed map (or every already created chunks).
Thanks for any suggestion that may help.

TheRaph
Fast Inserter
Fast Inserter
Posts: 226
Joined: Sun Sep 24, 2017 6:31 pm
Contact:

Re: command to summarise ore deposits

Post by TheRaph »

For every one who may search ... here the solution:

Code: Select all

/c for key, ent in pairs(game.surfaces[1].get_resource_counts()) do
	game.player.print(key .. " ==> "..ent)
end
Prints a list like:

Code: Select all

crude-oil ==> 33485265
iron-ore ==> 55259446
copper-ore ==> 28436455
uranium-ore ==> 6000469
coal ==> 28320813
stone ==> 21130127
If not used lua console script anyway, you have to enter this twice (or use up-arrow instead). This will disable all achievements due to using lua-script.

Post Reply

Return to “Gameplay Help”