556
个编辑
更改
无编辑摘要
end
return records
end
function get_score_limits(mode, level)
local score_limits = {}
local content
local found_level = false
if mode == '常规HS' then
content = mw.title.new('Ballance HS排行榜'):getContent()
elseif mode == '常规SR' then
content = mw.title.new('Ballance SR排行榜'):getContent()
else
return score_limits
end
for line in content:gmatch('[^\r\n]+') do
if string.sub(line, 1, string.len('| ')) == '| ' then
for element in line:gmatch("[^|]+") do
if element ~= '' then
element = trim(element)
if found_level then
table.insert(score_limits, element)
if #score_limits == 2 then
score_limits[1], score_limits[2] = score_limits[2], score_limits[1]
return score_limits
end
elseif element == level then
found_level = true
end
end
end
end
end
return score_limits
end
function get_score_limit_str(highest, score_limits)
local str = ''
local i, score_limit = next(score_limits)
if i ~= nil then
if highest == nil or score_less(highest, score_limit) then
local limit_str
if #score_limits == 1 then
limit_str = '上榜线'
elseif #score_limits == 2 then
limit_str = '精品线'
end
str = '|-\n|colspan{{-}}"4" style{{-}}"text-align: center;"|' .. limit_str .. ': ' .. score_limit .. '\n'
table.remove(score_limits, 1)
end
end
return str
end
local args = frame.args[1] and frame.args or frame:getParent().args;
local records = select_standing(get_records(), args[1], args[2])
local record_last score_limits = nilget_score_limits(args[1], args[2])
local ranking = 0
local ranking_hold = 0
if highest == nil or highest ~= remove_asterisk(record[score_col]) then
ranking_hold = ranking
highest = remove_asterisk(record[score_col])
wikitable_str = wikitable_str .. get_score_limit_str(highest, score_limits)
end
wikitable_str = wikitable_str .. '|-\n'
wikitable_str = wikitable_str .. '||' .. record[video_col]
wikitable_str = wikitable_str .. '\n'
end
wikitable_str = wikitable_str .. '|}\n'
local args = frame.args[1] and frame.args or frame:getParent().args;
local records = select_WR(get_records(), args[1], args[2])
local wikitable_str = '{| class="wikitable" style="display: inline-block; vertical-align: top"\n'
wikitable_str = wikitable_str .. '|+ <h3> 关卡 ' .. args[2] .. '</h3>\n'