Module:AutoUpdate:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第23行: | 第23行: | ||
local difficulty={ [0] = '[PST]', [1] = '[PRS]', [2] = '[FTR]' } | local difficulty={ [0] = '[PST]', [1] = '[PRS]', [2] = '[FTR]' } | ||
local condition={ [0] = '', [1] = 'C或以上', [2] = 'B或以上', [3] = 'A或以上', [4] = 'AA或以上', [5] = 'EX或以上' } | local condition={ [0] = '', [1] = 'C或以上', [2] = 'B或以上', [3] = 'A或以上', [4] = 'AA或以上', [5] = 'EX或以上' } | ||
return '[['..list['song_id']..']]'..difficulty[list['song_difficulty']]..condition[list['grade']]..'通过' | return '[['..list['song_id']..']]'..difficulty[list['song_difficulty']]..condition[list['grade']]..'通过\n' | ||
end, | end, | ||
[3] = function(list) | [3] = function(list) | ||
local difficulty={ [0] = '[PST]', [1] = '[PRS]', [2] = '[FTR]' } | local difficulty={ [0] = '[PST]', [1] = '[PRS]', [2] = '[FTR]' } | ||
return '游玩'..'[['..list['song_id']..']]'..difficulty[list['song_difficulty']] | return '游玩'..'[['..list['song_id']..']]'..difficulty[list['song_difficulty']]..'\n' | ||
end, | end, | ||
[4] = function(list) | [4] = function(list) |
2021年5月10日 (一) 22:38的版本
可在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']..'\s残片\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
return text[3]
end
return nil
end
return p