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
Revision as of 06:36, 29 July 2025 by Liam (talk | contribs) (Created page with "inspect = require("Module:InspectLua") local p = {} function p.pp(text) return mw.getCurrentFrame():preprocess(text) end function p.randomizeText (frame) local args = frame:getParent().args local textArray = {} local allText = args[1] for word in string.gmatch(allText, '[^\r\n]+') do table.insert(textArray, word) end math.randomseed(os.time()) local randomIndex = math.random(table.getn(textArray)) return p.pp(textArray[randomIndex]) end return p")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

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