Scrubby Dubby Saga Wikia
Advertisement

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

local p = {}
 
local function _getLevel( pageName, version )
	if not pageName or pageName == '' then return false end
 
	-- Setup
	local level = pageName:match('^Level (%d+)')
 
	-- Get difficulty for the page
	local data = mw.loadData( 'Module:Difficulty 3/List')
	local myDifficulty = data[tonumber(level)]
	if not myDifficulty then return false end
 
	-- Parse difficulty
	if type( myDifficulty ) == 'string' then
		return myDifficulty
	end
end
 
function p.getLevel( frame )
	local a = frame:getParent().args
	return _getLevel( a[1] or mw.title.getCurrentTitle().text, a[2] ) or a.default or 'Undetermined'
end
 
return p
Advertisement