Anonymous
×
Create a new article
Write your page title here:
We currently have 924 articles on WIKI - Flat MMO. Type your article name above or click on one of the titles below and start writing!



WIKI - Flat MMO
924Articles

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

 1 local p = {}
 2 
 3 function p.pp(text)
 4     return mw.getCurrentFrame():preprocess(text)
 5 end
 6 
 7 function p.randomizeText (frame)
 8 	local args = frame:getParent().args
 9 	local textArray = {}
10 	local allText = args[1]
11 	for word in string.gmatch(allText, '[^\r\n]+') do
12     	table.insert(textArray, word)
13 	end
14 
15 	math.randomseed(os.time())
16 	local randomIndex = math.random(table.getn(textArray))
17 	return p.pp(textArray[randomIndex])
18 end
19 
20 return p