How can I accurately know the number of items in a blueprint?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
User avatar
WIZ4
Fast Inserter
Fast Inserter
Posts: 209
Joined: Thu Apr 07, 2016 1:36 pm
Contact:

How can I accurately know the number of items in a blueprint?

Post by WIZ4 »

Screenshot_3.jpg
Screenshot_3.jpg (77.66 KiB) Viewed 3186 times
My native language is russian. Sorry if my messages are difficult to read.
danbopes
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Mon Feb 07, 2022 9:29 pm
Contact:

Re: How can I accurately know the number of items in a blueprint?

Post by danbopes »

I personally like using this mod: https://mods.factorio.com/mod/LogisticRequestManager

You can drag the blueprint to the blueprint icon in the bar (Assuming it's in your inventory and not in game blueprints), and it will create requests for all the items. Then you can drill into the requests and see the exact amounts needed for each item.

Other than that, you'd need to find/make a mod specifically for this, or write your own lua code. Alternatively, you could always export the blueprint to a string, decode it to json, and count the number via a simple script
danbopes
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Mon Feb 07, 2022 9:29 pm
Contact:

Re: How can I accurately know the number of items in a blueprint?

Post by danbopes »

It's not pretty, but I was bored, and created a simple lua function to do what you're asking:

Code: Select all

/c script.on_event(defines.events.on_gui_opened,function(event)
    if event.item == nil then return end
    if event.item.type ~= "blueprint" then return end
    
    for k, v in pairs(event.item.cost_to_build) do
        game.print("Item: " .. k .. ", Amount: " .. v)
    end
end)
Simply type this into the console (using the ` key), and then open your blueprint. You'll see each of the items output to the screen:
Image
User avatar
WIZ4
Fast Inserter
Fast Inserter
Posts: 209
Joined: Thu Apr 07, 2016 1:36 pm
Contact:

Re: How can I accurately know the number of items in a blueprint?

Post by WIZ4 »

It's enough. Thanks :)
My native language is russian. Sorry if my messages are difficult to read.
Post Reply

Return to “Gameplay Help”