「モジュール:SMWメンバー情報」の版間の差分
前田敦子、白石麻衣のように1グループしか所属してなかった人の選抜、センター回数の表記が?になっていたのを補正 |
5行目、書き方を訂正 |
||
| (同じ利用者による、間の13版が非表示) | |||
| 3行目: | 3行目: | ||
local function setProperty(dataStore) | local function setProperty(dataStore) | ||
-- メイン空間のみ | -- メイン空間のみ | ||
if | if mw.title.getCurrentTitle().namespace ~= 0 then | ||
return true; | return true; | ||
end | end | ||
| 61行目: | 61行目: | ||
dataStore["選抜回数"] = {} | dataStore["選抜回数"] = {} | ||
local lines_s = mw.text.split(args["選抜回数"]or "", '<br>') | local lines_s = mw.text.split(args["選抜回数"] or "", '<br>') | ||
mw.logObject(lines_s) | mw.logObject(lines_s) | ||
local total_s = 0 | local total_s = 0 | ||
| 70行目: | 70行目: | ||
-- If the group is not extracted, use the provided group | -- If the group is not extracted, use the provided group | ||
if not extractedGroup or extractedGroup == "" then | if not extractedGroup or extractedGroup == "" then | ||
extractedGroup = args[" | extractedGroup = args["元グループ"] or args["グループ"] or "" | ||
end | end | ||
-- If the num is nil, return an error | -- If the num is nil, return an error | ||
| 77行目: | 77行目: | ||
end | end | ||
-- Store the group and selection times | -- Store the group and selection times | ||
total_s = total_s + tonumber(num) | if tonumber(num) > 0 then | ||
total_s = total_s + tonumber(num) | |||
table.insert(dataStore["選抜回数"], extractedGroup .. ';' .. num) | |||
end | |||
end | end | ||
-- Add the total selection times to the dataStore | -- Add the total selection times to the dataStore | ||
| 86行目: | 88行目: | ||
dataStore["選抜回数"] = {} | dataStore["選抜回数"] = {} | ||
local lines_c = mw.text.split(args["センター回数"]or "", '<br>') | local lines_c = mw.text.split(args["センター回数"] or "", '<br>') | ||
mw.logObject(lines_c) | mw.logObject(lines_c) | ||
local total_c = 0 | local total_c = 0 | ||
| 95行目: | 97行目: | ||
-- If the group is not extracted, use the provided group | -- If the group is not extracted, use the provided group | ||
if not extractedGroup or extractedGroup == "" then | if not extractedGroup or extractedGroup == "" then | ||
extractedGroup = args[" | extractedGroup = args["元グループ"] or args["グループ"] or "" | ||
end | end | ||
-- If the num is nil, return an error | -- If the num is nil, return an error | ||
| 102行目: | 104行目: | ||
end | end | ||
-- Store the group and selection times | -- Store the group and selection times | ||
total_c = total_c + tonumber(num) | if tonumber(num) > 0 then | ||
total_c = total_c + tonumber(num) | |||
table.insert(dataStore["センター回数"], extractedGroup .. ';' .. num) | |||
end | |||
end | end | ||
-- Add the total selection times to the dataStore | -- Add the total selection times to the dataStore | ||
| 119行目: | 123行目: | ||
dataStore["選抜回数"] = {} | dataStore["選抜回数"] = {} | ||
local lines_s = mw.text.split(args["選抜回数"]or "", '<br>') | local lines_s = mw.text.split(args["選抜回数"] or "0回", '<br>') | ||
mw.logObject(lines_s) | mw.logObject(lines_s) | ||
local total_s = 0 | local total_s = 0 | ||
| 127行目: | 131行目: | ||
-- If the group is not extracted, use the provided group | -- If the group is not extracted, use the provided group | ||
if not extractedGroup or extractedGroup == "" then | if not extractedGroup or extractedGroup == "" then | ||
extractedGroup = args[" | extractedGroup = args["元グループ"] or args["グループ"] or "" | ||
num = mw.ustring.match(line, "(%d+)回") | num = mw.ustring.match(line, "(%d+)回") | ||
end | end | ||
| 135行目: | 139行目: | ||
end | end | ||
-- Store the group and selection times | -- Store the group and selection times | ||
total_s = total_s + tonumber(num) | if tonumber(num) > 0 then | ||
total_s = total_s + tonumber(num) | |||
table.insert(dataStore["選抜回数"], extractedGroup .. ';' .. num) | |||
end | |||
end | end | ||
-- Add the total selection times to the dataStore | -- Add the total selection times to the dataStore | ||
| 145行目: | 151行目: | ||
dataStore["センター回数"] = {} | dataStore["センター回数"] = {} | ||
local lines_c = mw.text.split(args["センター回数"]or "", '<br>') | local lines_c = mw.text.split(args["センター回数"] or "0回", '<br>') | ||
mw.logObject(lines_c) | mw.logObject(lines_c) | ||
local total_c = 0 | local total_c = 0 | ||
| 153行目: | 159行目: | ||
-- If the group is not extracted, use the provided group | -- If the group is not extracted, use the provided group | ||
if not extractedGroup or extractedGroup == "" then | if not extractedGroup or extractedGroup == "" then | ||
extractedGroup = args[" | extractedGroup = args["元グループ"] or args["グループ"] or "" | ||
num = mw.ustring.match(line, "(%d+)回") | num = mw.ustring.match(line, "(%d+)回") | ||
end | end | ||
| 161行目: | 167行目: | ||
end | end | ||
-- Store the group and selection times | -- Store the group and selection times | ||
total_c = total_c + tonumber(num) | if tonumber(num) > 0 then | ||
total_c = total_c + tonumber(num) | |||
table.insert(dataStore["センター回数"], extractedGroup .. ';' .. num) | |||
end | |||
end | end | ||
-- Add the total selection times to the dataStore | -- Add the total selection times to the dataStore | ||