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 Promethean Code", ["description"] = "Slip\ past\ Rasputin\'s\ defenses\ and\ download\ stealth\ code\ protocols\ from\ his\ Golden\ Age\ database\.", ["matchmaking"] = "False", ["icon"] = "File:Daily_Story_Mission_icon.png", ["location"] = "Earth", ["level"] = "41", ["activitysize"] = "3", ["fireteamsize"] = "1 to 3", ["skulls"] = { = "Heroic"}, ["rewards"] = { = {"Legendary Marks", 15}} },   ["dailycrucible"] = { ["title"] = "Salvage", ["description"] = "\"Treasures\ and\ forgotten\ tech\ lie\ waiting\ in\ the\ wake\ of\ the\ Golden\ Age\'s\ collapse\.\ One\ must\ be\ swift\ and\ fierce\ to\ claim\ them\.\"\ \—Lord\ Shaxx\ \ \ Race\ the\ other\ team\ to\ capture\ and\ hold\ relics\.", ["matchmaking"] = "True", ["icon"] = "File:Salvage_crucible_icon.png", ["location"] = "The Crucible", ["level"] = "1", ["activitysize"] = "6", ["fireteamsize"] = "1 to 3", ["skulls"] = {}, ["rewards"] = { = {"Legendary Marks", 15}} },   ["weeklycrucible"] = { ["title"] = "Doubles", ["description"] = "\"Leave\ no\ ally\ behind\,\ and\ no\ enemy\ standing\.\"\ \—Lord\ Shaxx\ \ \ Small\-team\ tactics\.\ Kill\ the\ enemy\.\ Revive\ teammates\.", ["matchmaking"] = "True", ["icon"] = "File:Weekly_Crucible_Playlist_icon.png", ["location"] = "The Crucible", ["level"] = "1", ["activitysize"] = "4", ["fireteamsize"] = "1 to 2", ["skulls"] = {}, ["rewards"] = { = {"Sterling Treasure", 1}} },   ["nightfall"] = { ["title"] = "The Undying Mind", ["description"] = "An\ ancient\ Mind\,\ feared\ by\ the\ Vex\ themselves\,\ hides\ among\ the\ channels\ of\ the\ Black\ Garden\.\ Find\ this\ machine\ and\ end\ its\ existence\.", ["matchmaking"] = "True", ["icon"] = "File:Nightfall_Strike_icon.png", ["location"] = "Mars", ["level"] = "42", ["activitysize"] = "3", ["fireteamsize"] = "1 to 3", ["skulls"] = { = "Epic", = "Void Burn",  = "Berserk",  = "Specialist",  = "Juggler"}, ["rewards"] = { = {"Unknown Rewards", 0}} },   ["heroicstrike"] = { ["title"] = "Vanguard Heroic Strikes", ["description"] = "Launches\ a\ random\ Heroic\ strike\.", ["matchmaking"] = "True", ["icon"] = "File:Vanguard_Heroic_Strikes_heroic_icon.png", ["location"] = "Earth", ["level"] = "41", ["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