Dump all machines using the "/c" command

Post all other topics which do not belong to any other category.
Post Reply
nalafxx
Manual Inserter
Manual Inserter
Posts: 1
Joined: Wed Oct 07, 2020 6:26 pm
Contact:

Dump all machines using the "/c" command

Post 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.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 4360
Joined: Tue Jul 12, 2016 9:03 am
Contact:

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

Post 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
Author of: Hand Crank Generator Deluxe, Screenshot Hotkey 2.0, /sudo
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

jodokus31
Filter Inserter
Filter Inserter
Posts: 710
Joined: Sun Feb 26, 2017 4:13 pm
Contact:

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

Post 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)

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3237
Joined: Tue May 13, 2014 11:06 am
Contact:

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

Post 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

Post Reply

Return to “General discussion”

Who is online

Users browsing this forum: Bing [Bot]