Module:Sandbox/MjolnirPants

local getArgs = require('Module:Arguments').getArgs p = {}

--Hurls a randomly generated, nonsensical insult. --Invoke using: -- 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 seed = math.floor(os.time) math.randomseed(seed) 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) insult = string.gsub(insult, "_2_", noun) return insult end

p.GraphSelector = function --initialize the random number genny local seed = math.floor(os.time) math.randomseed(seed) --Get the X and Y offsets local xOffset = math.random(10) * 250 local yOffset = math.random(10) * 250 --Concatenate the string and return it	local resString = "" return resString end

p.GraphPickerX = function local seed = math.floor(os.time) math.randomseed(seed) --Get the X and Y offsets local xOffset = math.random(0, 9) * 250 return xOffset end

p.GraphPickerY = function local seed = math.floor(os.time) + 1 -- just to be sure math.randomseed(seed) --Get the X and Y offsets local yOffset = math.random(0, 9) * 250 return yOffset end

function p.test(frame) local pgCont = mw.title.new("User:MjolnirPants/Voices"):getContent return pgCont end

function p.PingRFCUsers(frame) local args = getArgs(frame) return p._PingRFCUsers(args) end

function p._PingRFCUsers(args) local pageSource = "" --check the size of the arguments array --if there's more than one, the second one --should be the name of the page on which --to find the discussion if args[2] then --get the title from the second argument pageSource = mw.title.new(args[2]):getContent flag = 1 else --If no second parameter was passed, then --the discussion is on the current page pageSource = mw.title.getCurrentTitle:getContent flag = 2 end local users = {} local ii = 1 local i, j = string.find(pageSource, "==" .. args[1]) pageSource = string.sub(pageSource, i + string.len(args[1]) + 4) i, j = string.find(pageSource, "==") pageSource = string.sub(pageSource, 1, i - 1) i, j = string.find(pageSource, "%[%[User:") local uName = "" local k, l, m, n = i + 1 local cat = "Pinging participants of previous RfC: ~" -- local ret = "" --return pageSource.. "\r\nusers:" .. cat .. "\r\ni:" .. i .. " j:" .. j .. " k:" .. k .. " l:" .. l .. " m:" .. m .. " n:" .. n	return cat --return "\r\n" .. mw.title.new(args[2]):getContent end

return p