Module:Resources

--For use in automating assorted wiki functions and to reduce the number of updates needed local p = {} local ResourceData = mw.loadData( 'Module:Resources/data' )

function p.getResource(ResourceName) local resource = ResourceData["Resources"][ResourceName] if resource ~= nil and resource.Name == ResourceName then return resource end

return nil end

local function getValue(Resource, ValName) return Resource[ValName] end

function p.getValue(frame) local ResourceName = frame.args[1] local ValName1 = frame.args[2] local ValName2 = frame.args[3] if(ResourceName == nil) then return "" elseif(ValName1 == nil) then return "ERROR: No value selected" end local Resource = p.getResource(ResourceName) if(Resource == nil) then return "" end return getValue(Resource, ValName1) end

return p