2,544
次編輯
小 (thanks) |
小 (world) |
||
行 59: | 行 59: | ||
end | end | ||
end | end | ||
end | |||
function p.world() | |||
local world = mw.title.new "世界模式地图详表 (移动版)":getContent() | |||
local res = {} | |||
for name, wtb in world:gmatch "== *(.-) *==[^={]+(%b{})" do | |||
if name:sub(1, 1) == "B" then break end | |||
local tot | |||
for stair, reward in wtb:gmatch "| *(%d+)[0-9()%-| ]+(%b[])" do | |||
if slstIdx[reward:sub(3, -3)] then | |||
tot = tot or wtb:match "| *(%d+)[^\n]+\n|%-\n| *总计" | |||
table.insert(res, ("|-\n|%s||%s||%d/%d"):format(reward, name, tonumber(stair) - 1, tonumber(tot) - 1)) | |||
end | |||
end | |||
end | |||
return table.concat(res, "\n") | |||
end | end | ||
行 109: | 行 125: | ||
table.insert(wtb, table.concat({ "|-\n|[[" .. slstIdx[song.id].title .. "]]", unpack(song) }, "||")) | table.insert(wtb, table.concat({ "|-\n|[[" .. slstIdx[song.id].title .. "]]", unpack(song) }, "||")) | ||
end | end | ||
detail[key] = | detail[key] = table.concat(wtb, "\n") | ||
end | end | ||
return detail[frame.args[1]] | return detail[frame.args[1]] | ||
end | end | ||
return p | return p |
次編輯