Code: Select all
data.raw.recipe["productivity-module-3"].ingredients =
{
{"productivity-module-2", 4},
{"advanced-circuit", 5},
{"processing-unit", 5},
{"alien-artifact", 1}
}
So for your convenience and code-hygiene, here's my Factorio data skimmer/updater function "trawl":
Code: Select all
function trawl( class, check, ... ) for k,item in pairs( class ) do return check( k, item, ... ) end end
Code: Select all
trawl( data.raw.recipe["productivity-module-3"].ingredients,
function(k,item) if item[1] == "productivity-module-2" then item[2] = 4 end end
)