And following all ohter recipes which uses the engine-unit.
For now i do only print to log, but if it will work i want to add something to the engine unit recipe and following all recipes also
But the code fails me, it even prints to log the copper-plate recipe
After much trying i don't have a grip what is the error in this
Here is my code for the moment :
Code: Select all
recipetodo = "engine-unit"
if data.raw.recipe[recipetodo] then
log("found " ..recipetodo.. " recipe")
end
for i, recipe in pairs (data.raw.recipe) do
if data.raw["recipe"] then
for i, ingredient in pairs(data.raw["recipe"]) do
if ingredient.name == recipetodo then
log("found " ..ingredient.name.. " in recipe " ..recipe.name)
end
end
end
end
Anyone can help me and show me my error in this.....
Thanks a lot