Page 1 of 1

Dump all machines using the "/c" command

Posted: Mon Oct 12, 2020 1:36 pm
by nalafxx
I have dumped all recipes using a command I found here (it needs a bit of modification before it works)

I know that you can access all recipes at the game.player.force.recipes, but where can you find all machines? I tried finding it on the API but didn't really find anything other than the game.entity_prototypes, but you can't access the crafting speed and such from there.

Re: Dump all machines using the "/c" command

Posted: Mon Oct 12, 2020 2:05 pm
by eradicator
nalafxx wrote:
Mon Oct 12, 2020 1:36 pm
but you can't access the crafting speed and such from there.
Eh?

https://lua-api.factorio.com/latest/Lua ... ting_speed

Re: Dump all machines using the "/c" command

Posted: Mon Oct 12, 2020 3:42 pm
by jodokus31
I guess you have to access the prototypes in the data stage?
https://lua-api.factorio.com/latest/Data-Lifecycle.html

Or is it possible via /c command? (Probably is, somehow)

Re: Dump all machines using the "/c" command

Posted: Mon Oct 12, 2020 7:49 pm
by DaveMcW

Code: Select all

/c for _, m in pairs(game.entity_prototypes) do if m.crafting_speed then game.print(m.crafting_speed .. " " .. m.name) end end