Jump to content

Module:User:A diehard editor/Randmessage

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by A diehard editor (talk | contribs) at 10:57, 5 September 2022 (Created page with '------------------------------- ---- THIS IS A USER MODULE ---- ------------------------------- local p = {} local random_messages = { "Vandals are crucial in keeping Wikipedians employed... in the fields of counter-vandalism.", "If ClueBot NG became sentient, it would pay people to vandalize the encyclopedia so that it can keep its job.", "This user may or may not reply in International Phonetic Alphabet.", "'''Warning''': This...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
-------------------------------

---- THIS IS A USER MODULE ----

-------------------------------


local p = {}

local random_messages = {
	"[[WP:Vandals|Vandals]] are crucial in keeping Wikipedians employed... in the fields of counter-vandalism.",
	"If ClueBot NG became sentient, it would pay people to vandalize the encyclopedia so that it can keep its job.",
	"This user may or may not reply in [[International Phonetic Alphabet]].",
	"'''Warning''': This user uses mdy dates. {{small|This notice brought to you by the British Grammar Police.}}",
	"'''WARNING''': This user spells centre, colour, organisation, offence, and artefact wrong. {{small|This notice brought to you by the British Grammar Police.}}",
	"This user spells center, color, organization, offense, and artifact properly. {{small|Scored 100,000 on an American Grammar Police-provided English test.}}"
}

function arrlen(len)
	local incr=0
	for _ in pairs(len) do
		incr=incr+1
	end
	
	return incr
end

function p.random_msg()
	math.randomseed(os.clock()*10000000)
	math.random(); math.random(); math.random()

	return random_messages[math.random(arrlen(random_messages))]
end

return p