Module:LeveltypeDW

local p = {} local _lookupTable = 'Module:LeveltypeDW/List' local moves = 'Moves' local jelly = 'Jelly' local ingredients = 'Ingredients' local order = 'Candy Order' local function _lookupTypeStatus( levelName ) if levelName and not (levelName == '') then local level = levelName:match('^Level (%d+)/Dreamworld') if level then local data = mw.loadData( _lookupTable ) return data[tonumber(level)] end end return false end function p.type(frame) local leveltype = frame.args[1] local text = '' if _lookupTypeStatus(leveltype) == moves then text = "Moves" elseif _lookupTypeStatus(leveltype) == jelly then text = "Jelly" elseif _lookupTypeStatus(leveltype) == ingredients then text = "Ingredients" elseif _lookupTypeStatus(leveltype) == order then text = "Candy Order" else text = "Unknown" end return text end return p