Module:Aichan:修订间差异

添加476字节 、​ 2024年4月14日 (星期日)
加一点神秘参数
(强制免费曲在第一个,两个付费曲按更新时间排序;加入delay参数表示几天后)
(加一点神秘参数)
第33行: 第33行:
--   time: unix时间戳
--   time: unix时间戳
--   date: YYYY/MM/DD格式的时间, 按这一天的北京时间12:30算
--   date: YYYY/MM/DD格式的时间, 按这一天的北京时间12:30算
--     优先级: time > date > 读取当前时间
--   delay: 在得到的时间基础上再往后若干天
--   delay: 在得到的时间基础上再往后若干天
--  优先级: time > date > 读取当前时间
--    limit: 假设songlist只保留前limit项(用于模拟过去)
--   change显示“这一天的结果将在更新x首歌后变化”
local time = args['time'] or dateStringToTime(args['date']) or os.time()
local time = args['time'] or dateStringToTime(args['date']) or os.time()
time=time+86400*(args['delay'] or 0)
time=time+86400*(args['delay'] or 0)
第57行: 第59行:
local resultPaid={}
local resultPaid={}
local currentPaidCount=0
local currentPaidCount=0
local songSize=table.getn(songlist)
local songSize=args['limit'] or table.getn(songlist)
local next=length
for i=0,length-1,1 do
for i=0,length-1,1 do
if currentFreeCount+currentPaidCount>=3 then break end
if currentFreeCount+currentPaidCount>=3 then break end
第74行: 第77行:
end
end
end
end
else
next=math.min(next,value)
end
end
end
end
第93行: 第98行:
end
end
text = text:wikitext(frame:expandTemplate {title = '组排列-end'}):done()
text = text:wikitext(frame:expandTemplate {title = '组排列-end'}):done()
if args['change'] then
if next==length then
text=text:wikitext('<br>这一天的结果不再会随更新变化')
else
text=text:wikitext(string.format('<br>这一天的结果将在更新%d首歌后变化',next-songSize+1))
end
end
return text
return text
end
end


return p
return p
464

个编辑