Module:Trivia

--[=[

Lua Module for Trivia Functions

--]=]

local p = {} local util = require("Module:Utility") local ECR = require("Module:ECR").getTrivia local collectionData = mw.loadData( 'Module:ItemCollection/data' )

function p.main(frame) local tArgs = util.getArgs(frame)

local pagename = mw.title.getCurrentTitle.prefixedText local height = 13 local tOut = "" if collectionData["Items"][pagename] and collectionData["Items"][pagename][2] then local itemType = collectionData["Items"][pagename][2] if itemType == "ba" then height = 27 elseif itemType == "bc" or itemType == "d" then height = 47 elseif itemType == "pf" then height = 40 elseif itemType == "ch" or itemType == "cos" then height = 15 end end for i, item in pairs(tArgs) do tOut = "* " .. item .. "\n" .. tOut end

if collectionData["Items"][pagename] and collectionData["Items"][pagename][2] == "ch" then local TC = require("Module:MiniEvent").getCharTC tOut = TC({}) .. tOut end

if pagename:match("^Category%:") then tOut = '* ' .. table.concat(tArgs, "\n* ") .. '\n' end

if pagename:match("^Category%:") then tOut = '* ' .. table.concat(tArgs, "\n* ") .. '\n' end

tOut = '|-|Other Sources=\n \n' .. tOut .. ' \n'

return (table.concat(tArgs)~="" and tOut or "") .. (height>13 and ECR(pagename, height) or "") end

return p