--Info By Stapx Steve
--本模块包含一些用于获取底层数据的功能
local p = {} --p代表一个包(package)
-- 此方法用于获取 wiki 用户名对应的游戏内用户名
-- PS:只有页面名和游戏名不一样的需要增加到列表里
function p.getGameID(name)
local userList = {}
local page_name = {
"ClownPiece",
"Doodle",
"小龙",
"NSTeno",
"Mo xia"
}
local game_name = {
"Wakamiya_Eve",
"DoodleHuang",
"xiaolong2011",
"NSTeno_",
"mo__xia"
}
userList[1] = page_name
userList[2] = game_name
-- 检索数组
for i = 1, #userList[1] do
if(userList[1][i] == name)
then
return userList[2][i]
end
end
return name:gsub(" ", "_")
end
-- 根据页面 frame 直接获取游戏 ID
function p.getGameIDPage(frame)
local page_name = tostring(mw.title.getCurrentTitle())
return page_name
end
return p