Module:Beer

From Open Tibia Wiki

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

local p = {} --p stands for package

function p.hello( frame )
	local start = os.clock()
	local lang = mw.language.new('en')
	local parent = frame:getParent()
	local s = ""

	s = string.format("<p>Document: %s<br/>\nCode: [[%s]]<br/>\nLast refresh: %s</p>\n", parent:getTitle(), frame:getTitle(), os.date("%d %b %Y %X GMT"))

    --s = s .. "<p>Wiki metadata:<br/>\n"
	--for key, value in pairs(mw.site.stats) do
	--	if type(value) == 'number' then s = s .. string.format("%s: %d<br/>\n", lang:ucfirst(key), value, lang:ucfirst(key)) end
	--end
	--s = s .. "</p>\n"

	s = s .. "<p>"
    for i = 99,1,-1
	do
		s = s .. i .. " bottles of beer on the wall, " .. i .. " bottles of beer.<br/>Take one down and pass it around, " .. i-1 .. " bottles of beer on the wall.<br/>\n"
	end
	local stop = os.clock()
	s = s .. string.format("</p>\n<p>This page was generated in %d fractions of a second.</p>\n", 1/(stop-start))
	return s
end

return p