View source for Module:Data
Jump to navigation
Jump to search
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
local p = {}
local getArgs = require('Module:Arguments').getArgs
-- args:
-- subject: The subject entity to get data from.
--- E.g., "Kerbol", "LW-Sw "SWERV""
-- param: The parameter / parameter chain to access from the data page.
--- E.g., "mass", "max_temp", "modules|engine|isp_vac", "modules|generator|outputs|units"
function p.getData(frame)
local args = getArgs(frame)
local dataJson = mw.loadJsonData("Data:"..args[1])
local nextJson = ""
local dataValue = ""
local index = ''
for i = 2, table.maxn(args)-1 do
dataJson = dataJson[args[i]]
index = i
end
000
1:0
Templates used on this page:
Return to Module:Data.