Module:Sandbox/Skkias/TestDictionary

From Path of Exile 2 Wiki
Revision as of 15:49, 11 December 2024 by Skkias (talk | contribs) (Created page with "local p = {} -- Sample data for testing local dictionary = { ["Town"] = { ["Clearfell Encampment"] = "A large coastal city and key location in the story.", }, ["Mechanic"] = { ["Attack"] = "This is the ability that is attached to your weapon. Skills and modifiers are calculated separately from this.", }, } function p.getEntry(frame) local term = frame.args.term or "Unknown" local category = frame.args.category or "Town" if di...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Module documentation[create] [purge]
local p = {}

-- Sample data for testing
local dictionary = {
    ["Town"] = {
        ["Clearfell Encampment"] = "A large coastal city and key location in the story.",
    },
    ["Mechanic"] = {
        ["Attack"] = "This is the ability that is attached to your weapon. Skills and modifiers are calculated separately from this.",
    },
}

function p.getEntry(frame)
    local term = frame.args.term or "Unknown"
    local category = frame.args.category or "Town"
    if dictionary[category] and dictionary[category][term] then
        return dictionary[category][term]
    else
        return "Entry not found."
    end
end

return p