Module:ChartConstant
可在Module:ChartConstant/doc创建此模块的帮助文档
local p = {}
local json = require("Module:LoadJson").ChartConstant()
local getData = require("Module:Data").getMobile
function p.main()
local list = {}
local name
for i, k in pairs(json)
do
if k[2] or k[3] or k[4]
then
name = getData(nil,i)("title")
end
if k[2] and tonumber(k[2]['constant'])>=8 and not(k[2]['old']) then
table.insert(list, { i, name, k[2]['constant'], "PRS" })
end
if k[3] and tonumber(k[3]['constant'])>=8 and not(k[3]['old']) then
table.insert(list, { i, name, k[3]['constant'], "FTR" })
end
if k[4] and tonumber(k[4]['constant'])>=8 and not(k[4]['old']) then
table.insert(list, { i, name, k[4]['constant'], "BYD" })
end
end
local result = {}
for i=8.0,10.9,0.1 do
result[i] = {}
end
result[11], result[12] = {}, {}
for s, k in pairs(list) do
table.insert(result[k[3]],mw.getCurrentFrame():expandTemplate {{title = '组排单元', args = { list[2], list[1], list[4] }}} )
end
return table.concat(result[9.9])
end
return p