Jump to content

Module:Sandbox/Ahecht/sandbox: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
update
simplify
 
Line 12: Line 12:
mwSite = mwSite .. v
mwSite = mwSite .. v
elseif type(v) == 'table' then
elseif type(v) == 'table' then
for kk,vv in pairs(v) do if type(vv) == 'string' or type(vv) == 'number' then mwSite = mwSite .. '\n**mw.site.' .. k .. '.' .. kk .. ': ' .. vv end end
for kk,vv in pairs(v) do
if type(vv) == 'table' then vv = '[table]' end
if type(vv) ~= 'function' then
mwSite = mwSite .. '\n**mw.site.' .. k .. '.' .. kk .. ': ' .. vv
end
end
end
end
end
end

Latest revision as of 17:14, 21 March 2018

local p = {}

local function _main(args)
	return true
end

function p.main(frame)
	local mwSite = ''
	for k,v in pairs(mw.site) do
		mwSite = mwSite .. '\n*mw.site.' .. k .. ': '
		if type(v) == 'string' or type(v) == 'number' then
			mwSite = mwSite .. v
		elseif type(v) == 'table' then
			for kk,vv in pairs(v) do if type(vv) == 'string' or type(vv) == 'number' then mwSite = mwSite .. '\n**mw.site.' .. k .. '.' .. kk .. ': ' .. vv	end end
		end
	end
	return mwSite
end

return p