Module:Trivia

--[=[

Lua Module for Trivia Functions

--]=]

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

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

local pagename = mw.title.getCurrentTitle.text local height = 15 local tOut = "" if collectionData["Items"][pagename] and collectionData["Items"][pagename][2] then if collectionData["Items"][pagename][2] == "ba" then height = 20 elseif collectionData["Items"][pagename][2] == "bc" then height = 40 elseif collectionData["Items"][pagename][2] == "d" then height = 35 elseif collectionData["Items"][pagename][2] == "pf" then height = 27 end end for i, item in pairs(tArgs) do tOut = "* " .. item .. "\n" .. tOut end return '\n' .. tOut .. " " end

function p.infobox(frame) local tArgs = util.getArgs(frame) local tOut = "" local space = "" local i = 0 for item in mw.text.gsplit(tArgs[1], ', ') do tOut = tOut .. space .. item space = " " i = i + 1 end if i >= 5 then return ' ' .. tOut .. " "	else return tOut end end

return p