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 |
个编辑