模块:物品配方:修订间差异

添加428字节 、​ 2022年3月13日 (星期日)
上位物品
(创建页面,内容为“local p = {} function p.info(frame) local jsdata = mw.loadData("模块:物品配方/data") if jsdata[frame.args.name] == nil then return "" elseif jsdata[frame.args.name][frame.args.type] == nil then return "" else if frame.args.type == "配方" then local result = frame.args.name for i,v in ipairs(jsdata[frame.args.name][frame.args.type]) do if i == 1 then if v == 1 then result = result.."=" else result = result.."x"..v.."="…”)
 
(上位物品)
 
第33行: 第33行:
end
end
end
end
function p.upper(frame)
local jsdata = mw.loadData("模块:物品配方/data")
local result = ""
local flag = true
for key, value in pairs(jsdata) do
for i, v in ipairs(value["配方"]) do
if i ~= 1 then
if v[1] == frame.args.name then
if flag then
result = result.."[["..key.."]]"
flag = false
else result = result.."、[["..key.."]]"
end
end
end
end
end
return result
end


return p
return p