Data Exporter to JSON


Outputs|Exports a JSON file to /script-output/recipe-lister that lists all recipes, crafting machines, mining drills, belts, inserters, resources, items, fluids, and technologies loaded on player creation. Settings for split files and toggles for each category

Utilities
3 years ago
0.16 - 1.1
777

i manual trigger of the export would be nice

1 year, 2 months ago

When adding or deleting mods for an existing game, the data export gets not triggered since the player is not created.

to get current data a manual command to trigger the export would come handy.

5 months ago
(updated 5 months ago)

I needed this too - so FYI

  • Go to %appdata%\Factorio\mods\recipelister_2.8.0.zip\recipelister
  • Extract control.lua

So the first 3 lines are currently:

require("json")

function readFluidBox(pro)

Replace that with:

require("json")

remote.add_interface(
    "RecipeLister",
    {
        -- /c remote.call("RecipeLister", "consoleLog");
        consoleLog = function()
            consoleLog()
        end,

        -- /c remote.call("RecipeLister", "export_recipes");
        export_recipes = function()
            -- Use the player who executed the command
            local player = game.player
            if player then
                local event = { player_index = player.index }
                acquireData(event)
            else
                log("Error: Could not determine the player index.")
            end
        end
    }
)

function consoleLog()
    game.player.print "RecipeLister - This is not the greatest test text in the world, no. This is just a tribute! Couldn't remember the greatest test text in the world, yeah - no! This is a tribute! To the greatest test text in the world"
end

function readFluidBox(pro)

Or if you're not too comfortable editing LUA, here's the entire file you need: https://pastebin.com/raw/8migU8Yi - you can just copy that and paste everything into control.lua.

Once you're done editing, drop the control.lua file back into the zip folder, and override the existing file

Now you should be able to do:
- /c remote.call("RecipeLister", "consoleLog")

For testing purposes, to see if your changes actually worked

Or:
- /c remote.call("RecipeLister", "export_recipes")

To actually export everything

New response