Module:WeaponsmithingRecipes: Difference between revisions

From RuneTails
NES (talk | contribs)
No edit summary
NES (talk | contribs)
No edit summary
Line 617: Line 617:
                     if match then break end
                     if match then break end
                 end
                 end
            end
           
            -- Check if the page is a recipe name
            if not match and recipe.Recipe and pageName == recipe.Recipe then
                match = true
             end
             end
         end
         end
Line 652: Line 657:
     return result
     return result
end
end


return p
return p

Revision as of 20:35, 16 February 2025

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

local p = {}

local categories = {
    Nonconsumable = {
        'Broken Glass'
    }
}

-- Recipe table format: { Prod1Img, Prod1Qty, Prod1Name, Mat1Img, Mat1Qty, Mat1Name, Mat2Img, Mat2Qty, Mat2Name, Mat3Img, Mat3Qty, Mat3Name, Recipe, LvlReq, Exp, SellValue }

p.recipes = {
-- LEVEL 1 RECIPES
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Shield/ScrapShield.png',
        Prod1Qty = 1,
        Prod1Name = 'Scrap Shield',
        Mat1Img = 'https://runetails.com/Images/Items/General/BrokenGlass.png',
        Mat1Qty = 3,
        Mat1Name = ':Category:Nonconsumable|Any Nonconsumable Item',
        LvlReq = 1,
        Exp = 50,
        Recipe = 'Scrap Shield Blueprint',
        SellValue = 100
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/ClubWood.png',
        Prod1Qty = 1,
        Prod1Name = 'Wood Club',
        Mat1Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat1Qty = 1,
        Mat1Name = 'Wood',
        LvlReq = 1,
        Exp = 20,
        SellValue = 6
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Tool/SpadeWood.png',
        Prod1Qty = 1,
        Prod1Name = 'Wood Spade',
        Mat1Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat1Qty = 2,
        Mat1Name = 'Wood',
        LvlReq = 1,
        Exp = 40,
        SellValue = 12
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/HammerWood.png',
        Prod1Qty = 1,
        Prod1Name = 'Wood Hammer',
        Mat1Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat1Qty = 3,
        Mat1Name = 'Wood',
        LvlReq = 1,
        Exp = 60,
        SellValue = 14
    },

-- LEVEL 2 RECIPES

    {
        Prod1Img = 'https://runetails.com/Images/Items/Tool/PickaxeWood.png',
        Prod1Qty = 1,
        Prod1Name = 'Wood Pickaxe',
        Mat1Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat1Qty = 2,
        Mat1Name = 'Wood',
        LvlReq = 2,
        Exp = 40,
        SellValue = 12
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/AxeWood.png',
        Prod1Qty = 1,
        Prod1Name = 'Wood Axe',
        Mat1Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat1Qty = 2,
        Mat1Name = 'Wood',
        LvlReq = 2,
        Exp = 50,
        SellValue = 21
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/SwordWood.png',
        Prod1Qty = 1,
        Prod1Name = 'Wood Sword',
        Mat1Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat1Qty = 3,
        Mat1Name = 'Wood',
        LvlReq = 2,
        Exp = 60,
        SellValue = 25
    },

-- LEVEL 3 RECIPES

    {
        Prod1Img = 'https://runetails.com/Images/Items/Tool/SpadeStone.png',
        Prod1Qty = 1,
        Prod1Name = 'Stone Spade',
        Mat1Img = 'https://runetails.com/Images/Items/General/Stone.png',
        Mat1Qty = 1,
        Mat1Name = 'Stone',
        Mat2Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat2Qty = 1,
        Mat2Name = 'Wood',
        LvlReq = 3,
        Exp = 51,
        SellValue = 18
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/ClubStone.png',
        Prod1Qty = 1,
        Prod1Name = 'Stone Club',
        Mat1Img = 'https://runetails.com/Images/Items/General/Stone.png',
        Mat1Qty = 2,
        Mat1Name = 'Stone',
        LvlReq = 3,
        Exp = 61,
        SellValue = 36
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/HammerStone.png',
        Prod1Qty = 1,
        Prod1Name = 'Stone Hammer',
        Mat1Img = 'https://runetails.com/Images/Items/General/Stone.png',
        Mat1Qty = 3,
        Mat1Name = 'Stone',
        Mat2Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat2Qty = 1,
        Mat2Name = 'Wood',
        LvlReq = 3,
        Exp = 112,
        SellValue = 63
    },

-- LEVEL 4 RECIPES

    {
        Prod1Img = 'https://runetails.com/Images/Items/Tool/SpadeCopper.png',
        Prod1Qty = 1,
        Prod1Name = 'Copper Spade',
        Mat1Img = 'https://runetails.com/Images/Items/General/OreCopper.png',
        Mat1Qty = 1,
        Mat1Name = 'Copper Ore',
        Mat2Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat2Qty = 1,
        Mat2Name = 'Wood',
        LvlReq = 4,
        Exp = 56,
        SellValue = '[Unknown]'
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/General/CopperCup.png',
        Prod1Qty = 1,
        Prod1Name = 'Copper Cup',
        Mat1Img = 'https://runetails.com/Images/Items/General/OreCopper.png',
        Mat1Qty = 2,
        Mat1Name = 'Copper Ore',
        LvlReq = 4,
        Exp = 65,
        SellValue = '[Unknown]'
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/ClubCopper.png',
        Prod1Qty = 1,
        Prod1Name = 'Copper Club',
        Mat1Img = 'https://runetails.com/Images/Items/General/OreCopper.png',
        Mat1Qty = 2,
        Mat1Name = 'Copper Ore',
        LvlReq = 4,
        Exp = 72,
        SellValue = 152
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Tool/PickaxeStone.png',
        Prod1Qty = 1,
        Prod1Name = 'Stone Pickaxe',
        Mat1Img = 'https://runetails.com/Images/Items/General/Stone.png',
        Mat1Qty = 2,
        Mat1Name = 'Stone',
        Mat2Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat2Qty = 1,
        Mat2Name = 'Wood',
        LvlReq = 4,
        Exp = 82,
        SellValue = 31
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/SwordStone.png',
        Prod1Qty = 1,
        Prod1Name = 'Stone Sword',
        Mat1Img = 'https://runetails.com/Images/Items/General/Stone.png',
        Mat1Qty = 3,
        Mat1Name = 'Stone',
        LvlReq = 4,
        Exp = 92,
        SellValue = 90
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/AxeStone.png',
        Prod1Qty = 1,
        Prod1Name = 'Stone Axe',
        Mat1Img = 'https://runetails.com/Images/Items/General/Stone.png',
        Mat1Qty = 2,
        Mat1Name = 'Stone',
        Mat2Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat2Qty = 1,
        Mat2Name = 'Wood',
        LvlReq = 4,
        Exp = 102,
        SellValue = 73
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/HammerCopper.png',
        Prod1Qty = 1,
        Prod1Name = 'Copper Hammer',
        Mat1Img = 'https://runetails.com/Images/Items/General/OreCopper.png',
        Mat1Qty = 3,
        Mat1Name = 'Copper Ore',
        Mat2Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat2Qty = 1,
        Mat2Name = 'Wood',
        LvlReq = 4,
        Exp = 128,
        SellValue = 216
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/General/SilverSet.png',
        Prod1Qty = 1,
        Prod1Name = 'Silver Set',
        Mat1Img = 'https://runetails.com/Images/Items/General/SilverOre.png',
        Mat1Qty = 3,
        Mat1Name = 'Silver Ore',
        LvlReq = 4,
        Exp = 150,
        SellValue = 216
    },

-- LEVEL 5 RECIPES

    {
        Prod1Img = 'https://runetails.com/Images/Items/Tool/PickaxeCopper.png',
        Prod1Qty = 1,
        Prod1Name = 'Copper Pickaxe',
        Mat1Img = 'https://runetails.com/Images/Items/General/OreCopper.png',
        Mat1Qty = 2,
        Mat1Name = 'Copper Ore',
        Mat2Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat2Qty = 1,
        Mat2Name = 'Wood',
        LvlReq = 5,
        Exp = 93,
        SellValue = '[Unknown]'
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Tool/SpadeBronze.png',
        Prod1Qty = 1,
        Prod1Name = 'Bronze Spade',
        Mat1Img = 'https://runetails.com/Images/Items/General/OreCopper.png',
        Mat1Qty = 1,
        Mat1Name = 'Copper Ore',
        Mat2Img = 'https://runetails.com/Images/Items/General/OreTin.png',
        Mat2Qty = 1,
        Mat2Name = 'Tin Ore',
        Mat3Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat3Qty = 1,
        Mat3Name = 'Wood',
        LvlReq = 5,
        Exp = 93,
        SellValue = '[Unknown]'
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/SwordCopper.png',
        Prod1Qty = 1,
        Prod1Name = 'Copper Sword',
        Mat1Img = 'https://runetails.com/Images/Items/General/OreCopper.png',
        Mat1Qty = 3,
        Mat1Name = 'Copper Ore',
        LvlReq = 5,
        Exp = 109,
        SellValue = '[Unknown]'
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/AxeCopper.png',
        Prod1Qty = 1,
        Prod1Name = 'Copper Axe',
        Mat1Img = 'https://runetails.com/Images/Items/General/OreCopper.png',
        Mat1Qty = 2,
        Mat1Name = 'Copper Ore',
        Mat2Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat2Qty = 1,
        Mat2Name = 'Wood',
        LvlReq = 5,
        Exp = 118,
        SellValue = '[Unknown]'
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/ClubBronze.png',
        Prod1Qty = 1,
        Prod1Name = 'Bronze Club',
        Mat1Img = 'https://runetails.com/Images/Items/General/OreCopper.png',
        Mat1Qty = 2,
        Mat1Name = 'Copper Ore',
        Mat2Img = 'https://runetails.com/Images/Items/General/OreTin.png',
        Mat2Qty = 2,
        Mat2Name = 'Tin Ore',
        LvlReq = 5,
        Exp = 145,
        SellValue = '[Unknown]'
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/HammerBronze.png',
        Prod1Qty = 1,
        Prod1Name = 'Bronze Hammer',
        Mat1Img = 'https://runetails.com/Images/Items/General/OreCopper.png',
        Mat1Qty = 3,
        Mat1Name = 'Copper Ore',
        Mat2Img = 'https://runetails.com/Images/Items/General/OreTin.png',
        Mat2Qty = 3,
        Mat2Name = 'Tin Ore',
        LvlReq = 5,
        Exp = 239,
        SellValue = '[Unknown]'
    },

-- LEVEL 6 RECIPES

    {
        Prod1Img = 'https://runetails.com/Images/Items/Tool/PickaxeBronze.png',
        Prod1Qty = 1,
        Prod1Name = 'Bronze Pickaxe',
        Mat1Img = 'https://runetails.com/Images/Items/General/OreCopper.png',
        Mat1Qty = 2,
        Mat1Name = 'Copper Ore',
        Mat2Img = 'https://runetails.com/Images/Items/General/OreTin.png',
        Mat2Qty = 2,
        Mat2Name = 'Tin Ore',
        Mat3Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat3Qty = 1,
        Mat3Name = 'Wood',
        LvlReq = 6,
        Exp = 168,
        SellValue = '[Unknown]'
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/AxeBronze.png',
        Prod1Qty = 1,
        Prod1Name = 'Bronze Axe',
        Mat1Img = 'https://runetails.com/Images/Items/General/OreCopper.png',
        Mat1Qty = 2,
        Mat1Name = 'Copper Ore',
        Mat2Img = 'https://runetails.com/Images/Items/General/OreTin.png',
        Mat2Qty = 2,
        Mat2Name = 'Tin Ore',
        Mat3Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat3Qty = 1,
        Mat3Name = 'Wood',
        LvlReq = 6,
        Exp = 198,
        SellValue = '[Unknown]'
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/SwordBronze.png',
        Prod1Qty = 1,
        Prod1Name = 'Bronze Sword',
        Mat1Img = 'https://runetails.com/Images/Items/General/OreCopper.png',
        Mat1Qty = 3,
        Mat1Name = 'Copper Ore',
        Mat2Img = 'https://runetails.com/Images/Items/General/OreTin.png',
        Mat2Qty = 3,
        Mat2Name = 'Tin Ore',
        LvlReq = 6,
        Exp = 220,
        SellValue = '[Unknown]'
    },

-- LEVEL 7 RECIPES

    {
        Prod1Img = 'https://runetails.com/Images/Items/Tool/SpadeIron.png',
        Prod1Qty = 1,
        Prod1Name = 'Iron Spade',
        Mat1Img = 'https://runetails.com/Images/Items/General/OreIron.png',
        Mat1Qty = 1,
        Mat1Name = 'Iron Ore',
        Mat2Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat2Qty = 1,
        Mat2Name = 'Wood',
        LvlReq = 7,
        Exp = 116,
        SellValue = '[Unknown]'
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/ClubIron.png',
        Prod1Qty = 1,
        Prod1Name = 'Iron Club',
        Mat1Img = 'https://runetails.com/Images/Items/General/OreIron.png',
        Mat1Qty = 2,
        Mat1Name = 'Iron Ore',
        LvlReq = 7,
        Exp = 190,
        SellValue = '[Unknown]'
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/HammerIron.png',
        Prod1Qty = 1,
        Prod1Name = 'Iron Hammer',
        Mat1Img = 'https://runetails.com/Images/Items/General/OreIron.png',
        Mat1Qty = 3,
        Mat1Name = 'Iron Ore',
        Mat2Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat2Qty = 1,
        Mat2Name = 'Wood',
        LvlReq = 7,
        Exp = 307,
        SellValue = '[Unknown]'
    },

-- LEVEL 8 RECIPES

    {
        Prod1Img = 'https://runetails.com/Images/Items/Tool/PickaxeIron.png',
        Prod1Qty = 1,
        Prod1Name = 'Iron Pickaxe',
        Mat1Img = 'https://runetails.com/Images/Items/General/OreIron.png',
        Mat1Qty = 2,
        Mat1Name = 'Iron Ore',
        Mat2Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat2Qty = 1,
        Mat2Name = 'Wood',
        LvlReq = 8,
        Exp = 214,
        SellValue = '[Unknown]'
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/AxeIron.png',
        Prod1Qty = 1,
        Prod1Name = 'Iron Axe',
        Mat1Img = 'https://runetails.com/Images/Items/General/OreIron.png',
        Mat1Qty = 2,
        Mat1Name = 'Iron Ore',
        Mat2Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat2Qty = 1,
        Mat2Name = 'Wood',
        LvlReq = 8,
        Exp = 254,
        SellValue = '[Unknown]'
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/SwordIron.png',
        Prod1Qty = 1,
        Prod1Name = 'Iron Sword',
        Mat1Img = 'https://runetails.com/Images/Items/General/OreIron.png',
        Mat1Qty = 3,
        Mat1Name = 'Iron Ore',
        LvlReq = 8,
        Exp = 288,
        SellValue = '[Unknown]'
    },

-- LEVEL 9 RECIPES

    {
        Prod1Img = 'https://runetails.com/Images/Items/Tool/SpadeSteel.png',
        Prod1Qty = 1,
        Prod1Name = 'Steel Spade',
        Mat1Img = 'https://runetails.com/Images/Items/General/Coal.png',
        Mat1Qty = 3,
        Mat1Name = 'Coal',
        Mat2Img = 'https://runetails.com/Images/Items/General/OreIron.png',
        Mat2Qty = 1,
        Mat2Name = 'Iron Ore',
        Mat3Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat3Qty = 1,
        Mat3Name = 'Wood',
        LvlReq = 9,
        Exp = 167,
        SellValue = '[Unknown]'
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/General/SturdyTankard.png',
        Prod1Qty = 1,
        Prod1Name = 'Sturdy Tankard',
        Mat1Img = 'https://runetails.com/Images/Items/General/Coal.png',
        Mat1Qty = 1,
        Mat1Name = 'Coal',
        Mat2Img = 'https://runetails.com/Images/Items/General/OreIron.png',
        Mat2Qty = 1,
        Mat2Name = 'Iron Ore',
        Mat3Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat3Qty = 1,
        Mat3Name = 'Wood',
        LvlReq = 9,
        Exp = 215,
        SellValue = '[Unknown]'
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/ClubSteel.png',
        Prod1Qty = 1,
        Prod1Name = 'Steel Club',
        Mat1Img = 'https://runetails.com/Images/Items/General/Coal.png',
        Mat1Qty = 6,
        Mat1Name = 'Coal',
        Mat2Img = 'https://runetails.com/Images/Items/General/OreIron.png',
        Mat2Qty = 2,
        Mat2Name = 'Iron Ore',
        LvlReq = 9,
        Exp = 291,
        SellValue = '[Unknown]'
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/HammerSteel.png',
        Prod1Qty = 1,
        Prod1Name = 'Steel Hammer',
        Mat1Img = 'https://runetails.com/Images/Items/General/Coal.png',
        Mat1Qty = 9,
        Mat1Name = 'Coal',
        Mat2Img = 'https://runetails.com/Images/Items/General/OreIron.png',
        Mat2Qty = 3,
        Mat2Name = 'Iron Ore',
        Mat3Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat3Qty = 1,
        Mat3Name = 'Wood',
        LvlReq = 9,
        Exp = 459,
        SellValue = '[Unknown]'
    },

-- LEVEL 10 RECIPES

    {
        Prod1Img = 'https://runetails.com/Images/Items/Tool/PickaxeSteel.png',
        Prod1Qty = 1,
        Prod1Name = 'Steel Pickaxe',
        Mat1Img = 'https://runetails.com/Images/Items/General/Coal.png',
        Mat1Qty = 6,
        Mat1Name = 'Coal',
        Mat2Img = 'https://runetails.com/Images/Items/General/OreIron.png',
        Mat2Qty = 2,
        Mat2Name = 'Iron Ore',
        Mat3Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat3Qty = 1,
        Mat3Name = 'Wood',
        LvlReq = 10,
        Exp = 316,
        SellValue = '[Unknown]'
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/AxeSteel.png',
        Prod1Qty = 1,
        Prod1Name = 'Steel Axe',
        Mat1Img = 'https://runetails.com/Images/Items/General/Coal.png',
        Mat1Qty = 6,
        Mat1Name = 'Coal',
        Mat2Img = 'https://runetails.com/Images/Items/General/OreIron.png',
        Mat2Qty = 2,
        Mat2Name = 'Iron Ore',
        Mat3Img = 'https://runetails.com/Images/Items/General/Wood.png',
        Mat3Qty = 1,
        Mat3Name = 'Wood',
        LvlReq = 10,
        Exp = 366,
        SellValue = '[Unknown]'
    },
    {
        Prod1Img = 'https://runetails.com/Images/Items/Equipment/Weapon/SwordSteel.png',
        Prod1Qty = 1,
        Prod1Name = 'Steel Sword',
        Mat1Img = 'https://runetails.com/Images/Items/General/Coal.png',
        Mat1Qty = 9,
        Mat1Name = 'Coal',
        Mat2Img = 'https://runetails.com/Images/Items/General/OreIron.png',
        Mat2Qty = 3,
        Mat2Name = 'Iron Ore',
        LvlReq = 10,
        Exp = 441,
        SellValue = '[Unknown]'
    },
}

function p.get_recipes_by_material(frame)
    local material = frame.args[1] or ''
    local pageName = mw.title.getCurrentTitle().text -- Get the current page name
    local result = ''

    local showAll = (pageName == "Weaponsmithing Recipes")

    for _, recipe in ipairs(p.recipes) do
        local match = showAll

        if not match then
            -- Check if the page is a product
            if pageName == recipe.Prod1Name or (recipe.Prod2Name and pageName == recipe.Prod2Name) then
                match = true
            end
            
            -- Check if the page is a material
            if not match then
                for i = 1, 4 do
                    local matName = recipe["Mat" .. i .. "Name"]
                    if matName then
                        if matName:match(':Category:') then
                            local categoryName = matName:match(':Category:([^|]+)')
                            if categories[categoryName] then
                                for _, categoryItem in ipairs(categories[categoryName]) do
                                    if material == categoryItem then
                                        match = true
                                        break
                                    end
                                end
                            end
                        elseif material == matName then
                            match = true
                        end
                    end
                    if match then break end
                end
            end
            
            -- Check if the page is a recipe name
            if not match and recipe.Recipe and pageName == recipe.Recipe then
                match = true
            end
        end

        if match then
            result = result .. '<tr>'
            result = result .. '<td style="width: 50px;">' .. recipe.Prod1Img ..
                (recipe.Prod2Img and '<br>' .. recipe.Prod2Img .. '' or '') .. '</td>'
            result = result .. '<td>' .. recipe.Prod1Qty .. ' x [[' .. recipe.Prod1Name .. ']]' ..
                (recipe.Prod2Name and '<br>' .. recipe.Prod2Qty .. ' x [[' .. recipe.Prod2Name .. ']]' or '') .. '</td>'

            result = result .. '<td>'
            for i = 1, 4 do
                if recipe["Mat" .. i .. "Name"] then
                    result = result .. recipe["Mat" .. i .. "Qty"] .. ' x ' .. recipe["Mat" .. i .. "Img"] ..
                        ' [[' .. recipe["Mat" .. i .. "Name"] .. ']]' .. '<br>'
                end
            end
            result = result .. '</td>'

            result = result .. '<td>' .. recipe.LvlReq .. '</td>'
            result = result .. '<td>' .. recipe.Exp .. '</td>'
            
            -- Recipe Requirement Column
            result = result .. '<td style="text-align: center;">'
            if recipe.Recipe then
                result = result .. 'https://runetails.com/Images/Items/General/Recipe.png<br>[[' .. recipe.Recipe .. ']]'
            end
            result = result .. '</td>'
            
            result = result .. '<td>' .. recipe.SellValue .. '</td>'
            result = result .. '</tr>'
        end
    end
    return result
end


return p