Внимание! Начат процесс обновления Wiki до версии игры 10.x. Если у Вас есть желание принять участие, то Вы можете найти больше информации в нашем ECO Contribution Wiki Discord.

Модуль:Ecopedia

Материал из Eco - Русская Wiki
Перейти к:навигация, поиск

Для документации этого модуля может быть создана страница Модуль:Ecopedia/doc

local p = {}

function norm()
    local origArgs = mw.getCurrentFrame():getParent().args
    local args = {}
    
    for k, v in pairs( origArgs ) do
        v = mw.text.trim( tostring( v ) )
        if v ~= '' then
            args[k] = v
        end
    end
    
    return args
end

function p.main()

    local args = norm()
    
	if args.text == nil or args.text == '' then
        return '\'text\' must be specified.'
    end

    local index = args.text

	if index == '' then
		return '\'text\' must be specified.'
    end

        Data = require( "Module:EcopediaData" )
        String = Data.text[index]

if String == {} then return Data.. ' could not be found in Module:EcopediaData.' end

return String

end
return p