Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Counter

From Teriock

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

local p = {}

-- Table to hold multiple counters if needed
local counters = {}

function p.increment(frame)
    local name = frame.args[1] or "default"
    counters[name] = (counters[name] or 0) + 1
    return counters[name]
end

function p.reset(frame)
    local name = frame.args[1] or "default"
    counters[name] = 0
end

return p