Module:CardSearch

local p = {} function p.getdata local monsterdata = mw.loadData("Module:MonsterData") local skillcatdata = mw.loadData("Module:SkillCatData")

local monsterdata_ = {} for _, v in pairs(monsterdata) do table.insert(monsterdata_, v) end table.sort(monsterdata_, function(v1,v2) return tonumber(v1.monsterid) < tonumber(v2.monsterid) end)

local array_div = {}

for _, data in ipairs(monsterdata_) do       local skillcatid = {} for _, data_skill in ipairs(skillcatdata) do           for _, id in ipairs(data_skill.ids) do                if id == data.monsterid then table.insert(skillcatid, data_skill.catid) end end end local temp_div = mw.html.create("div") :attr("data-attack", data.attack) :attr("data-attribute", data.attribute) :attr("data-hp", data.hp) :attr("data-monsterid", data.monsterid) :attr("data-racialtype", data.racialtype) :attr("data-recover", data.recover) :attr("data-seriesid", data.seriesid) :attr("data-cost", data.cost) :attr("data-star", data.star) :attr("data-skillcatid", table.concat(skillcatid, ",")) :tag("div") :css('display', 'inline-block') :css('position', 'relative') :css('width', '60px') :css('height', '60px') :css('margin', '0 0 8.4px') :wikitext("") :tag("span") :addClass("monsterLv") :css('font-size', '10.8px') :css('line-height', '16.8px') :css('white-space', 'nowrap') :wikitext("Lv.0") :done :done

table.insert(array_div, tostring(temp_div)) end return table.concat(array_div) end return p