Module:QueryNationSummary

From Victory Belles Community Wiki
Revision as of 22:43, 27 June 2023 by WikiAdmin (talk | contribs) (Created page with "local p = {} local cargo = mw.ext.cargo function p.main ( frame ) local tables = "JOINNation" local fields = "TXT_IngameNationDescription" local cargoArgs = { where = "JOINNation.TXT_ShortName = '" .. frame.args.nation .. "'", default ='Description not defined', limit = 1 } local results = cargo.query( tables, fields, cargoArgs ) for r = 1, #results do local result = results[r] if result == nil then return 'E...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation for this module may be created at Module:QueryNationSummary/doc

local p = {}
local cargo = mw.ext.cargo

function p.main ( frame )
    local tables = "JOINNation"
    local fields = "TXT_IngameNationDescription"

    local cargoArgs = {
        where = "JOINNation.TXT_ShortName = '" .. frame.args.nation .. "'",
		default ='Description not defined',
		limit = 1
    }
    local results = cargo.query( tables, fields, cargoArgs )
    for r = 1, #results do
        local result = results[r]
        if result == nil then
        	return 'Empty Cargo...'
    	else 
        	return result.TXT_IngameNationDescription
    	end
    end
end

return p