Module:Ep/Switcher

local p = {} -- function to take a given value of "ep" and return the episode's name and CxEE code function p.epSwitcher(frame, reference) -- Get ep value entered from template local ep   if reference and frame.args["ep"] then ep = frame.args["ep"] elseif reference and not isnotempty(frame.args["ep"]) then return " Undefined Episode ", "" elseif reference then ep = "0x00" elseif not isnotempty(frame.args[1]) then return "", "" else ep = frame.args[1] end -- the "part" variable is only used here for Trial of the Take episodes local part if reference then part = frame.args["part"] or nil end if not isnotempty(part) then part = "" end -- Get episode name and CxEE code

-- MOONSEA EPISODES if ep == "1" or ep == "01" or ep == "001" or ep == "Episode 1" or ep == "Episode 01" or ep == "Episode 001" or ep == "1x01" or ep == "A Mysterious Letter" then epName, CxEE = "A Mysterious Letter", "1x01" elseif ep == "2" or ep == "02" or ep == "002" or ep == "Episode 2" or ep == "Episode 02" or ep == "Episode 002" or ep == "1x02" or ep == "Skull and Bone" then epName, CxEE = "Skull and Bone", "1x02" elseif ep == "3" or ep == "03" or ep == "003" or ep == "Episode 3" or ep == "Episode 03" or ep == "Episode 003" or ep == "1x03" or ep == "Wraith in the Darkness" then epName, CxEE = "Wraith in the Darkness", "1x03" elseif ep == "4" or ep == "04" or ep == "004" or ep == "Episode 4" or ep == "Episode 04" or ep == "Episode 004" or ep == "1x04" or ep == "A Mask of Bone" then epName, CxEE = "A Mask of Bone", "1x04" elseif ep == "5" or ep == "05" or ep == "005" or ep == "Episode 5" or ep == "Episode 05" or ep == "Episode 005" or ep == "2x01" or ep == "What's the Phlan?" then epName, CxEE = "What's the Phlan?", "2x01" elseif ep == "6" or ep == "06" or ep == "006" or ep == "Episode 6" or ep == "Episode 06" or ep == "Episode 006" or ep == "2x02" or ep == "The Tale of Jebediah Slamgood" then epName, CxEE = "The Tale of Jebediah Slamgood", "2x02" elseif ep == "7" or ep == "07" or ep == "007" or ep == "Episode 7" or ep == "Episode 07" or ep == "Episode 007" or ep == "2x03" or ep == "Turning Pirate" then epName, CxEE = "Turning Pirate", "2x03" elseif ep == "8" or ep == "08" or ep == "008" or ep == "Episode 8" or ep == "Episode 08" or ep == "Episode 008" or ep == "2x04" or ep == "Into the Catacombs" then epName, CxEE = "Into the Catacombs", "2x04" elseif ep == "9" or ep == "09" or ep == "009" or ep == "Episode 9" or ep == "Episode 09" or ep == "Episode 009" or ep == "2x05" or ep == "Infiltrating the Tower" then epName, CxEE = "Infiltrating the Tower", "2x05" elseif ep == "10" or ep == "10" or ep == "010" or ep == "Episode 10" or ep == "Episode 10" or ep == "Episode 010" or ep == "2x06" or ep == "One Bad Slaad" then epName, CxEE = "One Bad Slaad", "2x06" elseif ep == "11" or ep == "11" or ep == "011" or ep == "Episode 11" or ep == "Episode 11" or ep == "Episode 011" or ep == "2x07" or ep == "A Look in the Mirror" then epName, CxEE = "A Look in the Mirror", "2x07" elseif ep == "12" or ep == "12" or ep == "012" or ep == "Episode 12" or ep == "Episode 12" or ep == "Episode 012" or ep == "2x08" or ep == "Golem SMASH!" then epName, CxEE = "Golem SMASH!", "2x08" elseif ep == "13" or ep == "13" or ep == "013" or ep == "Episode 13" or ep == "Episode 13" or ep == "Episode 013" or ep == "2x09" or ep == "Loose Ends" then epName, CxEE = "Loose Ends", "2x09" elseif ep == "14" or ep == "14" or ep == "014" or ep == "Episode 14" or ep == "Episode 14" or ep == "Episode 014" or ep == "3x01" or ep == "The Road to Melvaunt" then epName, CxEE = "The Road to Melvaunt", "3x01" elseif ep == "15" or ep == "15" or ep == "015" or ep == "Episode 15" or ep == "Episode 15" or ep == "Episode 015" or ep == "3x02" or ep == "Passing Through" then epName, CxEE = "Passing Through", "3x02" elseif ep == "16" or ep == "16" or ep == "016" or ep == "Episode 16" or ep == "Episode 16" or ep == "Episode 016" or ep == "3x03" or ep == "Children in the Dark" then epName, CxEE = "Children in the Dark", "3x03" elseif ep == "17" or ep == "17" or ep == "017" or ep == "Episode 17" or ep == "Episode 17" or ep == "Episode 017" or ep == "3x04" or ep == "Here Kitty Kitty" then epName, CxEE = "Here Kitty Kitty", "3x04" elseif ep == "18" or ep == "18" or ep == "018" or ep == "Episode 18" or ep == "Episode 18" or ep == "Episode 018" or ep == "3x05" or ep == "All Faiths" then epName, CxEE = "All Faiths", "3x05" elseif ep == "19" or ep == "19" or ep == "019" or ep == "Episode 19" or ep == "Episode 19" or ep == "Episode 019" or ep == "3x06" or ep == "Actions and Consequences" then epName, CxEE = "Actions and Consequences", "3x06" elseif ep == "100" or ep == "Episode 100" or ep == "8x01" or ep == "Session Name Here" then epName, CxEE = "Session Name Here", "8x01" elseif ep == "101" or ep == "Episode 101" or ep == "8x02" or ep == "Episode 101" then epName, CxEE = "Episode 101", "8x02" elseif ep == "102" or ep == "Episode 102" or ep == "8x03" or ep == "Episode 102" then epName, CxEE = "Episode 102", "8x03" elseif ep == "103" or ep == "Episode 103" or ep == "8x04" or ep == "Episode 103" then epName, CxEE = "Episode 103", "8x04" elseif ep == "104" or ep == "Episode 104" or ep == "8x05" or ep == "Episode 104" then epName, CxEE = "Episode 104", "8x05" elseif ep == "105" or ep == "Episode 105" or ep == "8x06" or ep == "Episode 105" then epName, CxEE = "Episode 105", "8x06" elseif ep == "106" or ep == "Episode 106" or ep == "8x07" or ep == "Episode 106" then epName, CxEE = "Episode 106", "8x07" elseif ep == "107" or ep == "Episode 107" or ep == "8x08" or ep == "Episode 107" then epName, CxEE = "Episode 107", "8x08" elseif ep == "108" or ep == "Episode 108" or ep == "8x09" or ep == "Episode 108" then epName, CxEE = "Episode 108", "8x09" elseif ep == "109" or ep == "Episode 109" or ep == "8x10" or ep == "Episode 109" then epName, CxEE = "Episode 109", "8x10" elseif ep == "110" or ep == "Episode 110" or ep == "8x11" or ep == "Episode 110" then epName, CxEE = "Episode 110", "8x11" else return ep, "" end return epName, CxEE end -- function to determine that a variable has a value function isnotempty(s) return s ~= nil and s~= '' end return p