更改

跳转至: 导航搜索

模块:Standings

添加590字节2022年11月18日 (五) 23:45
无编辑摘要
local video_col = 5
local date_col = 6
 
-- .0 => .4999, .5 => .9999
function expand_from_old_SR_time(score)
if score:len() == 6 then
if score:sub(-1) == '0' then
score = score:sub(1, -2) .. '4999'
elseif score:sub(-1) == '5' then
score = score:sub(1, -2) .. '9999'
end
end
return score
end
 
function score_less_SR(a, b)
a = expand_from_old_SR_time(a)
b = expand_from_old_SR_time(b)
return a > b
end
 
function score_less_HS(a, b)
return a < b
end
 
function remove_asterisk(score)
if score:sub(-1) == '*' then
score = score:sub(1, -2)
end
return score
end
-- compare score, including HS and SR
function score_less(a, b)
a = remove_asterisk(a)
b = remove_asterisk(b)
if string.find(a, ':') and string.find(b, ':') then
return score_less_SR(a > , b)
elseif not string.find(a, ':') and not string.find(b, ':') then
return score_less_HS(a < , b)
end
end
local record = records[i]
if record[mode_col] == mode and record[level_col] == level then
if highest == nil or not score_less(highest, record[score_col], highest) then
table.insert(records_new, record)
highest = record[score_col]
end
function get_sorted_recordsget_records()
local content = mw.title.new('Ballance个人纪录列表'):getContent()
local records = {}
function p.standings(frame)
local args = frame.args[1] and frame.args or frame:getParent().args;
local records = select_standing(get_sorted_recordsget_records(), args[1], args[2])
local record_last = nil
local ranking = 0
function p.historical_WRs(frame)
local args = frame.args[1] and frame.args or frame:getParent().args;
local records = select_WR(get_sorted_recordsget_records(), args[1], args[2])
local date_until = 0
local scire_until = 0
556
个编辑

导航菜单