Module:RecipeUtils

From Eco - English Wiki
Revision as of 09:49, 17 August 2025 by StalEF (talk | contribs) (Created page with "local Utils = require('Module:Utils') local p = {} function p.ItemCraft(ItemName) local Recipes = "" for RecipeName,RecipeData in pairs(RecipesData.recipes) do for IngredientName,IngredientData in pairs(RecipeData.Ingredients) do if IngredientName == ItemName then if (Recipes == "") then Recipes = Recipes .. RecipeName else Recipes = Recipes .. ", " .. RecipeName end end end end return...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:RecipeUtils/doc

local Utils = require('Module:Utils')

local p = {}

function p.ItemCraft(ItemName)
    local Recipes = ""
    for RecipeName,RecipeData in pairs(RecipesData.recipes) do
        for IngredientName,IngredientData in pairs(RecipeData.Ingredients) do
            if IngredientName == ItemName then
                if (Recipes == "") then Recipes = Recipes .. RecipeName else Recipes = Recipes .. ", " .. RecipeName end
            end
        end
    end
           
    return Recipes
end

return p