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"] = "The Coming War", ["description"] = "Travel\ to\ Phobos\ and\ investigate\ the\ Cabal\ distress\ signal\.", ["matchmaking"] = "False", ["icon"] = "File:Daily_Story_Mission_icon.png", ["location"] = "Phobos", ["level"] = "42", ["activitysize"] = "3", ["fireteamsize"] = "1 to 3", ["skulls"] = { = "Heroic"}, ["rewards"] = { = {"Legendary Marks", 15}} },   ["dailycrucible"] = { ["title"] = "Clash", ["description"] = "\"No\ mercy\.\ No\ hesitation\.\ It\'ll\ take\ nothing\ less\ to\ defeat\ the\ Darkness\.\"\ \—Lord\ Shaxx\ \ \ All\-out\ team\ warfare\.\ Destroy\ the\ enemy\.", ["matchmaking"] = "True", ["icon"] = "File:Clash.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"] = "Dust Palace", ["description"] = "A\ new\ Cabal\ force\ has\ unleashed\ powerful\ Psion\ Flayers\ to\ seize\ control\ of\ the\ old\ Martian\ Warmind\.\ Face\ this\ new\ threat\ and\ secure\ what\ remains\ of\ the\ ancient\ network\.", ["matchmaking"] = "True", ["icon"] = "File:Nightfall_Strike_icon.png", ["location"] = "Mars", ["level"] = "42", ["activitysize"] = "3", ["fireteamsize"] = "1 to 3", ["skulls"] = { = "Epic", = "Void Burn",  = "Berserk",  = "Ironclad",  = "Catapult"}, ["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