2,717
个编辑
NegativeTriu(讨论 | 贡献) (创建页面,内容为“local p = {} function p.info(frame) local jsdata = mw.text.jsonDecode(mw.getCurrentFrame():expandTemplate{title = "物品信息/json"}) local num = tonumber…”) |
NegativeTriu(讨论 | 贡献) 无编辑摘要 |
||
| 第4行: | 第4行: | ||
local jsdata = mw.text.jsonDecode(mw.getCurrentFrame():expandTemplate{title = "物品信息/json"}) | local jsdata = mw.text.jsonDecode(mw.getCurrentFrame():expandTemplate{title = "物品信息/json"}) | ||
local num = tonumber(frame.args.num) | local num = tonumber(frame.args.num) | ||
if jsdata[frame.args.name][num] == nil then return "" | if jsdata[frame.args.name] == nil then return "" | ||
elseif jsdata[frame.args.name][num] == nil then return "" | |||
else return jsdata[frame.args.name][num] | else return jsdata[frame.args.name][num] | ||
end | end | ||