Module:200mxp

This is the current revision of this page, as edited by Alex (talk | contribs) at 23:59, 16 October 2024 (Created page with "-- <pre> local p = {} local lookuptable = require("Module:200mxp/data") local gamemodeindex = { ["all"] = 1, ["im"] = 2, ["uim"] = 3, ["hcim"] = 4 } local function lookup(skill,gamemode) local info = lookuptable[skill] if info == nil then return 'Invalid {{{1}}} param' elseif skill=='update' then return info else return info[gamemodeindex[gamemode] or 1] end end function p.lookup(frame) local args = frame:getParent().args local skill = string.lower(..."). The present address (URL) is a permanent link to this version.

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Module documentation
This documentation is transcluded from Template:No documentation/doc. [edit] [history] [purge]
This module does not have any documentation. Please consider adding documentation at Module:200mxp/doc. [edit]
Module:200mxp's function lookup is invoked by Template:200mxp.
Module:200mxp requires Module:200mxp/data.

-- <pre>

local p = {}

local lookuptable = require("Module:200mxp/data")

local gamemodeindex = {
	["all"] = 1,
	["im"] = 2,
	["uim"] = 3,
	["hcim"] = 4
}

local function lookup(skill,gamemode)
	local info = lookuptable[skill]
	if info == nil then
		return 'Invalid {{{1}}} param'
	elseif skill=='update' then
		return info
	else
		return info[gamemodeindex[gamemode] or 1]
	end
end

function p.lookup(frame)
	local args = frame:getParent().args
	local skill = string.lower(args[1] or '')
	local gamemode = string.lower(args[2] or 'all')
	return lookup(skill,gamemode)
end

return p