Module:METables

--[[ Lua script to get Mini Event Tables

getMilestones: get Milestones Table based on input parameters Parameters: 1 =        2 =         3 = --]]

local p = {}

local util = require('Module:Utility') local ME = require("Module:MiniEvent").getME local TOK = require("Module:CharacterToken").getToken local MULT = require("Module:MultiItems").getItems local TYPE = require("Module:NavboxItems").itemType

function p.getMilestones(frame) local tArgs = util.getArgs(frame) local tOut = '{| class="article-table dmk-milestone" style="width: 100%;"\n' local tMil = '|-\n!Milestone\n' local tRew = '|-\n!Rewards\n' local k = 0 for i, item in pairs(tArgs) do		local iType = TYPE({(tArgs[k + 2] or "")}) if tArgs[k + 1] then tMil = tMil .. "!" .. ME({"", "", "N"}) .. "'''" .. tArgs[k + 1] .. "'''\n" end if tArgs[k + 2] then tRew = tRew .. "|"			if iType == "Unknown Item" then tRew = tRew .. TOK({tArgs[k + 2], "30"}) elseif iType == "pf" then tRew = tRew .. MULT({tArgs[k + 2], iType, "40", "Float"}) elseif iType == "ec" then tRew = tRew .. MULT({tArgs[k + 2] .. "s", iType, "40", "Chests"}) else tRew = tRew .. MULT({tArgs[k + 2], iType, "40"}) end end if tArgs[k + 3] and tArgs[k + 3] ~= 0 then tRew = tRew .. " '''" .. tArgs[k + 3] .. "'''"  		end if tArgs[k + 2] then if iType == "Unknown Item" then tRew = tRew .. " " .. TOK({tArgs[k + 2], "T"}) elseif iType == "ec" then tRew = tRew .. " " .. tArgs[k + 2] .. "" else tRew = tRew .. " " .. tArgs[k + 2] .. "" end end if tArgs[k + 3] and tArgs[k + 3] > "1" then tRew = tRew .. "s \n" elseif tArgs[k + 3] then tRew = tRew .. " \n" end k = k + 3 end return tOut .. tMil .. tRew .. "|}" end

return p