Module:Activities

--Defines global variable for return local p = {}

--All information of the current daily/weekly activities --This table is updated by User:DestinyWikiBot. DO NOT change any comments containing the HTML tag: local activity_table = { --   ["dailychapter"] = { ["title"] = "Queen's Ransom", ["description"] = "Follow\ Skolas\ into\ Vex\ territory\ to\ aid\ in\ his\ capture\ for\ the\ Queen\.", ["matchmaking"] = "False", ["icon"] = "File:Daily_Story_Mission_icon.png", ["location"] = "Venus", ["level"] = "42", ["activitysize"] = "3", ["fireteamsize"] = "1 to 3", ["skulls"] = { = "Heroic"}, ["rewards"] = { = {"Legendary Marks", 15}} },   ["dailycrucible"] = { ["title"] = "Rift", ["description"] = "\"This\ all\ started\ as\ a\ Warlock\ focus\ drill\.\ The\ things\ I\'ve\ seen\ them\ do\ with\ Rifts\ would\ be\.\.\.very\ useful\ on\ a\ battlefield\.\"\ \—Lord\ Shaxx\ \ \ Collect\ the\ Spark\ and\ ignite\ the\ enemy\'s\ Rift\ with\ it\.", ["matchmaking"] = "True", ["icon"] = "File:Rift_crucible_icon.png", ["location"] = "The Crucible", ["level"] = "1", ["activitysize"] = "12", ["fireteamsize"] = "1 to 6", ["skulls"] = {}, ["rewards"] = { = {"Legendary Marks", 15}} },   ["weeklycrucible"] = { ["title"] = "Zone Control", ["description"] = "\"It\'s\ a\ tactical\ exercise\ in\ reinforcing\ and\ defending\ acquired\ territory\.\ Should\ the\ Vanguard\ ever\ decide\ to\ expand\ past\ the\ walls\ of\ the\ City\,\ the\ Guardians\ will\ be\ ready\.\"\ \—Lord\ Shaxx\ \ Capture\ zones\ and\ hold\ the\ zones\ to\ win\.", ["matchmaking"] = "True", ["icon"] = "File:Weekly_Crucible_Playlist_icon.png", ["location"] = "The Crucible", ["level"] = "1", ["activitysize"] = "12", ["fireteamsize"] = "1 to 6", ["skulls"] = {}, ["rewards"] = { = {"Radiant Treasure", 1}} },   ["nightfall"] = { ["title"] = "The Nexus", ["description"] = "The\ Vex\ world\-eating\ machine\ below\ the\ Academy\ has\ reawakened\.\ Descend\ and\ dismantle\ the\ Mind\ that\ controls\ it\.", ["matchmaking"] = "True", ["icon"] = "File:Weekly_Heroic_Strike_icon.png", ["location"] = "Venus", ["level"] = "42", ["activitysize"] = "3", ["fireteamsize"] = "1 to 3", ["skulls"] = { = "Epic", = "Brawler",  = "Grounded",  = "Fresh Troops",  = "Ironclad"}, ["rewards"] = { = {"Unknown Rewards", 0}} },   ["heroicstrike"] = { ["title"] = "SIVA Crisis Heroic", ["description"] = "Launch\ a\ random\ SIVA\ Crisis\ Heroic\ Strike\.", ["matchmaking"] = "True", ["icon"] = "File:Weekly_Heroic_Strike_icon.png", ["location"] = "Earth", ["level"] = "42", ["activitysize"] = "3", ["fireteamsize"] = "1 to 3", ["skulls"] = { = "Heroic", = "Arc Burn",  = "Solar Burn",  = "Void Burn",  = "Berserk",  = "Brawler",  = "Lightswitch",  = "Small Arms",  = "Specialist",  = "Juggler",  = "Grounded",  = "Bloodthirsty",  = "Chaff",  = "Fresh Troops",  = "Ironclad",  = "Match Game",  = "Exposure",  = "Airborne",  = "Catapult"}, ["rewards"] = { = {"Legendary Engram", 0}} } -- } --Main page function returns values in main page friendly format function p.mainpage ( frame ) --Sets activity type (activity) and activity information key (info) from arguments. local activity = string.lower( frame.args[1] ) local info = string.lower( frame.args[2] ) --If the activity type doesn't exist, returns false if not activity_table[activity] then return false end --If activity info value is a table, parses into string format if (type(activity_table[activity][info]) == "table") then --Creates local string to return local string = "" --If the activity info is skulls if (info == "skulls") then --Loops through table and returns in format 20px|DESCRIPTION for skullfile, skullname in pairs(activity_table[activity][info]) do               string = string .. "20px|" .. skullname .. " " end --If the activity info is rewards elseif (info == "rewards") then --Loops through table and returns in format 20px|link=PAGENAME( x #) where x # only appears when >1 rewards retrieved for rewardsfile, rewardsinfo in pairs(activity_table[activity][info]) do               string = string .. "20px|link=" .. rewardsinfo[1] .. "" if (rewardsinfo[2] > 1) then string = string .. " x " .. rewardsinfo[2] .. " "               else string = string .. " "               end end end return string end

--Adds returned information to global variab;e return activity_table[activity][info] end

--Main page function returns values in portal friendly format function p.portal ( frame ) --Sets activity type (activity) and activity information key (info) from arguments. local activity = string.lower( frame.args[1] ) local info = string.lower( frame.args[2] ) --If the activity type doesn't exist, returns false if not activity_table[activity] then return false end --If activity info value is a table, parses into string format if (type(activity_table[activity][info]) == "table") then --Creates local string to return local string = "" --If the activity info is skulls if (info == "skulls") then --Loops through table and returns in format 20px|DESCRIPTION for skullfile, skullname in pairs(activity_table[activity][info]) do               string = string .. "*20px|" .. skullname .. " " .. skullname .. "\n" end --If the activity info is rewards elseif (info == "rewards") then --Loops through table and returns in format 20px|link=PAGENAME( x #) where x # only appears when >1 rewards retrieved for rewardsfile, rewardsinfo in pairs(activity_table[activity][info]) do               string = string .. "*20px|link=" .. rewardsinfo[1] .. " " .. rewardsinfo[1] .. "" if (rewardsinfo[2] > 1) then string = string .. " x " .. rewardsinfo[2] .. "\n" else string = string .. "\n" end end end return string end

--Adds returned information to global variable return activity_table[activity][info] end

return p