Module:AutoUpdate
可在Module:AutoUpdate/doc创建此模块的帮助文档
local getArgs = require('Module:Arguments').getArgs
local data=require('模块:Data')
local p = {}
local function makeInvokeFunc(funcName)
return function (frame)
local args = getArgs(frame)
return p[funcName](args)
end
end
p.unlockA = makeInvokeFunc('_unlockA')
function p._unlockA(args)
local con=data.unlock("espebranch")
local text={'','',''}
local switch = {
[0] = function(list)
return list['credit']..' 残片 \n'
end,
[1] = function(list)
local difficulty={ [0] = '[PST]', [1] = '[PRS]', [2] = '[FTR]' }
local condition={ [0] = '', [1] = 'C或以上', [2] = 'B或以上', [3] = 'A或以上', [4] = 'AA或以上', [5] = 'EX或以上' }
return '[['..list['song_id']..']]'..difficulty[list['song_difficulty']]..condition[list['grade']]..'通过 \n'
end,
[3] = function(list)
local difficulty={ [0] = '[PST]', [1] = '[PRS]', [2] = '[FTR]' }
return '游玩'..'[['..list['song_id']..']]'..difficulty[list['song_difficulty']]..' \n'
end,
[4] = function(list)
--没时间后面再做
return nil
end
}
for i=1,3 do
if con[i] then
for o,n in ipairs(con[i]) do
text[i]=text[i]..switch[n['type']](n)
end
end
end
return text[3]
end
return p