Module:Soreness: Difference between revisions

From Growtopia
Jump to navigationJump to search
>Sorenesss
No edit summary
>Sorenesss
No edit summary
Line 12: Line 12:
     -- Construct the desired <img> tag
     -- Construct the desired <img> tag
     local imgTagOld = '<img src="https://static.wikia.nocookie.net/growtopia/images/6/6c/'..input..'/revision/latest/scale-to-width-down/'..newwidth..'" alt="Generated Image">'
     local imgTagOld = '<img src="https://static.wikia.nocookie.net/growtopia/images/6/6c/'..input..'/revision/latest/scale-to-width-down/'..newwidth..'" alt="Generated Image">'
     local imgTag = 'https://static.wikia.nocookie.net/growtopia/images/6/6c/'..input..'/revision/latest/scale-to-width-down/'..newwidth..'>'
     local imgTag = 'https://static.wikia.nocookie.net/growtopia/images/6/6c/'..input..'/revision/latest/scale-to-width-down/'..newwidth


     -- Construct the final output with the growsprite span
     -- Construct the final output with the growsprite span

Revision as of 12:24, 20 November 2024

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

local p = {}

function p.test(frame)
    -- Ensure 'class' is initialized as a table
    local class = {}
    table.insert(class, "growsprite")

    -- Get the input argument
    local input = frame.args[1] or "" -- Default to an empty string if not provided
    local newwidth = frame.args[2] or "32" -- Default to an empty string if not provided

    -- Construct the desired <img> tag
    local imgTagOld = '<img src="https://static.wikia.nocookie.net/growtopia/images/6/6c/'..input..'/revision/latest/scale-to-width-down/'..newwidth..'" alt="Generated Image">'
    local imgTag = 'https://static.wikia.nocookie.net/growtopia/images/6/6c/'..input..'/revision/latest/scale-to-width-down/'..newwidth

    -- Construct the final output with the growsprite span
    return "<span class='" .. table.concat(class, " ") .. "'>" .. imgTag .. "</span>[[Category:AutoPurge]]"
end
 
return p