Module:Sandbox/Aurelain/SkillInfobox: Difference between revisions
From Heroes of Might and Magic: Olden Era Official Wiki
No edit summary |
No edit summary |
||
| Line 17: | Line 17: | ||
table.insert(results, faction) | table.insert(results, faction) | ||
end | end | ||
return table.concat(results, '\n') | return dump(results) | ||
--return table.concat(results, '\n') | |||
end | end | ||
return p | return p | ||
Revision as of 11:02, 26 August 2026
Documentation for this module may be created at Module:Sandbox/Aurelain/SkillInfobox/doc
-- This module is intended as a supporting muscle for the SkillInfobox template.
local p = {}
-- Displays a variable
------------------------------------------------------------------------------------------------------------------------
local function dump(target)
return '<pre>' .. mw.dumpObject(target) .. '</pre>'
end
------------------------------------------------------------------------------------------------------------------------
function p.listEpicClasses(frame)
local csv = frame.args.epic_classes or ''
local epicClasses = mw.text.split(csv, ',')
local results = {}
for _, epicId in ipairs(epicClasses) do
local faction, type = epicId:match('([^_]+)_([^_]+)_[0-9]$')
table.insert(results, faction)
end
return dump(results)
--return table.concat(results, '\n')
end
return p


