Module:Test

local Test = {}

local timelineData = mw.loadData ( 'Module:AutoUniverse/Timelines' )

function Test.test1(frame) local text = frame.args[1] or frame.args["test"] --local split = mw.text.split('*Zero Era*Build Fighters*Anno Domini*Cosmic Era', '%*') local split = mw.text.split(text, '%*') for i, j in ipairs(split) do       --mw.log(j) return j   end end

function Test.test2(frame) --local text = frame.args[1] or frame.args["test"] local split = mw.text.split('*Zero Era\n*Build Fighters\n*Anno Domini\n*Cosmic Era', '\n') for i, j in ipairs(split) do       local ouniverse = string.lower(j) ouniverse = string.gsub(ouniverse, "%[", "") ouniverse = string.gsub(ouniverse, "%]", "") ouniverse = string.gsub(ouniverse, "%*", "") ouniverse = string.gsub(ouniverse, "%:", "") ouniverse = string.gsub(ouniverse, "%", "") ouniverse = string.gsub(ouniverse, "%|", "") ouniverse = string.gsub(ouniverse, "wcgundam", "") stringOne = string.sub(ouniverse, 1, string.len(ouniverse)/2) stringTwo = string.sub(ouniverse, string.len(ouniverse)/2+1, string.len(ouniverse)) if (stringOne == stringTwo) then ouniverse = stringOne end ouniverse2 = timelineData[ouniverse] or "" ouniverse3 = "" if not (ouniverse3 == "[[Category:]]") then --mw.log(ouniverse3) return ouniverse3 end end end

return Test --