Jump to content

Module:Sandbox/MjolnirPants

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by MPants at work (talk | contribs) at 19:46, 23 January 2018 (creating page for lua scripts). 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)
p = {}

--Hurls a randomly generated, nonsensical insult.
--Invoke using:
--{{#invoke:MjolnirPants|NonsenseNameCaller}}
p.NonsenseNameCaller = function()
	--set up the syntax
	local syntaxes = {
		"You are a _1_ _2_.", 
		"Go away, you _1_ _2_.", 
		"You _1_ _2_.", 
		"Have you always been so _1_, you _2_?", 
		"Listen, _2_, stop being so _1_."
	}
	local syntaxMax = 5
	
	--set up the adjective
	local adjectives = {
		"bildering",
		"globulish",
		"pustulating",
		"gilberous",
		"blartous"
	}
	local adjMax = 5
	
	--set up the noun
	local nouns = {
		"bustule",
		"narklaholic",
		"gandypuffer",
		"dorkleragger",
		"plonk"
	}
	local nounMax = 5
	
	--pick the three elements
	local syntax = syntaxes[math.random(syntaxMax)]
	local adjective = adjectives[math.random(adjMax)]
	local noun = nouns[math.random(nounMax)]
	
	--make the insult
	local insult = string.gsub(syntax, "_1_", adjective)
	return string.gsub(insult, "_2_", noun)
end

return p