跳到内容
折叠侧栏
搜索
创建账号
个人工具
创建账号
登录
导航
首页
最近更改
随机页面
编者用页面
方针
指引
讨论版
格式手册
挂起清单
维护清单
玩法条目
游戏玩法
界面
机制
搭档
潜力值
Link Play
世界模式
故事模式
段位挑战
解歌系统
成就系统
版本更新日志
列表条目
定数表
曲目列表
曲包列表
曲师列表
谱师列表
画师列表
背景列表
友情链接
Rotaeno中文维基
工具
链入页面
相关更改
特殊页面
页面信息
查看“Module:ArtistSong”的源代码
模块
讨论
English
阅读
查看源代码
查看历史
更多
阅读
查看源代码
查看历史
←
Module:ArtistSong
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
p={} local CAL = mw.loadJsonData 'User:Economy666/ComplexArtistsList.json' local multiId = mw.loadJsonData 'Template:Transition.json'.multiId local mad = require 'Module:AnotherData' local function readList() local pickList = {} local pickListBYD = {} for _, song in ipairs(mad.listOf('songs', 'mobile')) do local artist = song.artist pickList[song.id] = song.artist if song.difficulties[4] and song.difficulties[4].artist and song.difficulties[4].artist~=artist then local bydArtist = song['difficulties'][4]['artist'] pickListBYD[song['id']] = bydArtist end end for _, song in ipairs(mad.listOf('songs', 'ns')) do if not pickList[song.id] and not multiId[song.id] then pickList[song.id] = song.artist if song.difficulties[4] and song.difficulties[4].artist then bydArtist = song['difficulties'][4]['artist'] pickListBYD[song['id']] = bydArtist end end end return pickList, pickListBYD end local function convertPick(pickList, pickListBYD) convertList = {} for _id,_ in pairs(pickList) do local artist = pickList[_id] if not convertList[artist] then convertList[artist] = {} end if not convertList[artist].normal then convertList[artist]['normal'] = {} end table.insert(convertList[artist]['normal'], _id) end for _id in pairs(pickListBYD) do local artist = pickListBYD[_id] if not convertList[artist] then convertList[artist] = {} end if not convertList[artist].beyond then convertList[artist]['beyond'] = {} end table.insert(convertList[artist]['beyond'], _id) end return convertList end local function genList(convertList) local function cate(singleList, cArtist, artist) local artist = artist or cArtist if not singleList[artist] then singleList[artist] = {} end if convertList[cArtist].beyond then if not singleList[artist].beyond then singleList[artist]['beyond'] = {} end for _,i in pairs(convertList[cArtist]['beyond']) do table.insert(singleList[artist]['beyond'],i) end end if convertList[cArtist].normal then if not singleList[artist].normal then singleList[artist]['normal'] = {} end for _,i in pairs(convertList[cArtist]['normal']) do table.insert(singleList[artist]['normal'],i) end end return singleList end local singleList = {} for cArtist in pairs(convertList) do if CAL[cArtist] then for _,text in pairs(CAL[cArtist]) do if text.link then artist = text['link'] singleList = cate(singleList, cArtist, artist) end end else singleList = cate(singleList, cArtist) end end return singleList end function p.main() local rl, rlb = readList() local cl = convertPick(rl, rlb) local gl = genList(cl) local wikiText = "{| class=\"wikitable\"\n" wikiText = wikiText .. "! Artist !! Songs\n" for name, item in pairs(gl) do if item.beyond and item.normal then wikiText = wikiText .. "|-\n| rowspan=\"2\" | " .. name .. "\n" wikiText = wikiText .. "| " .. mw.text.jsonEncode(item.normal) .. "\n" wikiText = wikiText .. "|-\n|'''BYD''':" .. mw.text.jsonEncode(item.beyond) .. "\n" else wikiText = wikiText .. "|-\n| " .. name .. " || " if item.normal then wikiText = wikiText .. mw.text.jsonEncode(item.normal) .. "\n" elseif item.beyond then wikiText = wikiText .. " '''BYD''' :" .. mw.text.jsonEncode(item.beyond) .. "\n" end end end wikiText = wikiText .. "|}" return wikiText end return p
本页使用的模板:
Module:ArtistSong/doc
(
查看源代码
)
返回
Module:ArtistSong
。