Module:Dia code

--[[

This module is intended to provide an alt text (text that appears when the image doesn't load or is copied to a plaintext editor) for the image on, and to provide an appropriate link to the character when the image is clicked. It is a replacement for Template:Dia/code. ]]

local p = {}

--[[

This table provides the alt text and link destination for each code used in the Dia template. For codes not listed in the table, the alt text and link destination is equal to the code itself.

Each line has the following form: {"code", "alt text", "link destination"}, OR {"code", "alt text and link destination"},

In the alt text, put the name of the character for the code or describe it. In the link destination, provide the name of the article/page which describes the character for the code. If the alt text and link destination is equal, use the latter form, which only has two entries.

To not link to any article at all (for example, an article for the character doesn't exist, or the character is actually two characters whose relationship page doesn't exist), leave the link destination blank, like this: {"code", "alt text", ""} ]]

local codes = { {"?", "Unknown", ""}, {"27ITBM", "27 is the best number", "User:27 is the best number"}, {"4Intro", "Four"}, {"8B", "8-Ball"}, {"8Ball", "8-Ball"}, {"8BallBite", "8-Ball"}, {"8ballInhale", "8-Ball"}, {"Pim", "8-Ball"}, {"9ball", "9-Ball"}, {"ABFDI", "A BFDI"}, {"ABNTT", "A Better Name Than That"}, {"ABNTTBleh", "A Better Name Than That and Bleh", ""}, {"ActionPen", "Pen"}, {"AirhornEB", "Airhorn", "User:EdwardBloxy"}, {"AkivaS", "Akiva Schaffer", "wikipedia:Akiva Schaffer"}, {"AndyS", "Andy Samberg", "wikipedia:Andy Samberg"}, {"AngeryDavid", "David"}, {"Angry 8-Ball", "8-Ball"}, {"AngryFour", "Four"}, {"Ann", "Announcer"}, {"Apple", "Apple", "w:c:inanimateinsanity:Apple"}, {"Arm", "Assets", "Assets/Faces and limbs"}, {"Axol", "Axol", "w:c:supermarioglitchy4:Axol"}, {"B Bag", "Barf Bag"}, {"Baldi", "Baldi", "w:c:baldis-basics-in-education-and-learning:Baldi"}, {"BaldiAngry", "Baldi", "w:c:baldis-basics-in-education-and-learning:Baldi"}, {"BallIcon", "Balloony"}, {"BALLoony", "Balloony"}, {"Balloony&Woody", "Balloony and Woody", ""}, {"BalloonyDab", "Balloony"}, {"BalloonyOrange", "Balloony"}, {"BalloonyScream", "Balloony"}, {"BarfBag", "Barf Bag"}, {"BaskIcon", "Basketball"}, {"Battle for B.F.D.I.", "Battle for BFDI"}, {"BAWOONY", "Balloony"}, {"BB", "Basketball"}, {"BBall", "Basketball"}, {"BBallOrange", "Basketball"}, {"Beach Ball", "Beach Ball", "User:BFDI Rocky"}, {"BellAngry", "Bell"}, {"Bellay", "Bell and Naily", ""}, {"BellIcon", "Bell"}, {"BFDIFAN1234567", "BFDIFAN1234567", "User:BFDIFAN1234567"}, {"BH", "Black Hole"}, {"BHole", "Black Hole"}, {"BHole&Bottle", "Black Hole and Bottle", ""}, {"Billow", "Pillow"}, {"BIM", "Black Internet Man", "User:EdwardBloxy"}, {"BITBC", "Blue Is the Best Color Version 2", "User:Blue Is the Best Color Version 2"}, {"BLiy", "Liy"}, {"BloodySpongy", "Spongy"}, {"Bluey", "BlueyColors", "User:EdwardBloxy"}, {"BobSMG4", "Bob", "w:c:supermarioglitchy4:Bob"}, {"Bocky", "Bocky", "Blocky"}, {"Bomb", "Bomb", "w:c:inanimateinsanity:Bomb"}, {"BombyP", "Bomby"}, {"BombySmile", "Bomby"}, {"BookAAA", "Book"}, {"BookDerp", "Book"}, {"BookHNG", "Book"}, {"BoomMic", "Boom Mic"}, {"Boopkins", "Fishy Boopkins", "w:c:supermarioglitchy4:Fishy Boopkins"}, {"BottIcon", "Bottle"}, {"BottleCookie", "Bottle"}, {"BP", "Bubble and Pin"}, {"BR", "Bubble and Ruby", "Ruby/Relationships#Bubble"}, {"BraceletySign", "Bracelety"}, {"BubbleEvil", "Evil Bubble"}, {"BubbleIcon", "Bubble"}, {"BubbleMetal", "Metal Bubble", "Bubble"}, {"BubbleVsmile", "Bubble"}, {"Caedmon", "Caedmon Johnson"}, {"CakeExcited", "Cake"}, {"CakesDad", "Cake's Dad", "Recommended Characters/BFB 7#cakes dad"}, {"Callme", "Needle"}, {"CameraMad", "Camera"}, {"CarrotCake1", "Carrot Cake"}, {"CarrotCake2", "Carrot Cake"}, {"Cary", "Cary Huang"}, {"CGINeedle", "Needle"}, {"CharlesC", "Charles Calvin", "w:c:henrystickmin:Charles Calvin"}, {"CheeseOrb", "Cheese Orb"}, {"Choco", "ChocolateBliss", "User:ChocolateBliss"}, {"CKH", "Cary Huang"}, {"CloudyOrange", "Cloudy"}, {"CloudyOrangeNoTape", "Cloudy"}, {"CloudyTape", "Cloudy"}, {"CoinyDEL", "Coiny"}, {"CoinyIcon", "Coiny"}, {"CompanionCubeEB", "Companion Cube", "User:EdwardBloxy"}, {"Companionly", "Creator of Companionly", "User:DoodleYT"}, {"ConchShell", "Conch Shell"}, {"CultistEtG","The Cultist", ""}, {"CursedAnn", "Cursed Announcer With Body"}, {"Cutie", "Cutiesunflower", "User:Cutiesunflower"}, {"DavidHueh", "David"}, {"DavidOrange", "David"}, {"Deimos", "Deimos", "wikipedia:Deimos (moon)"}, {"DeimosMC", "Deimos", "w:c:madnesscombat:Deimos"}, {"Derpy", "Derpyunikitty", "User:Derpyunikitty"}, {"Derpyunikitty", "Derpyunikitty", "User:Derpyunikitty"}, {"Desti", "Desti", "w:c:supermarioglitchy4:Desti"}, {"Dia", "Dia", "Template:Dia"}, {"Dino", "michael as a dinosaur", "Recommended Characters/BFB 12"}, {"Don't call me Needy!", "Needle"}, {"DonutHWA", "Donut"}, {"DonutSo", "Donut"}, {"DonutVomit", "Donut"}, {"Doodle", "DoodleYT", "User:DoodleYT"}, {"DoraPonytail", "Dora"}, {"DPACT", "Death P.A.C.T."}, {"Duck", "A duck"}, {"Edward", "EdwardBloxy", "User:EdwardBloxy"}, {"Eggs", "ScribbledEggs", "User:ScribbledEggs"}, {"EightEEE", "Eight"}, {"EightNew", "Eight"}, {"ELeafy", "Evil Leafy"}, {"EllieRose", "Ellie Rose", "w:c:henrystickmin:Ellie Rose"}, {"Empty", ""}, {"Enzo", "Enzosmile", "User:Enzosmile"}, {"EpeeFencing", "Epee", "User:Minardi-LMS"}, {"EraserIcon", "Eraser"}, {"Everyone", "Everyone", "List of Battle for Dream Island characters"}, {"EvilLeafy", "Evil Leafy"}, {"Fanny(Old)", "Fanny"}, {"fannyascii", "Fanny"}, {"FannyIcon", "Fanny"}, {"fannymatrix", "Fanny"}, {"FannyOld", "Fanny"}, {"Fannyy", "Fanny"}, {"FearfulWarpII", "FearfulWarpII", "User:FearfulWarpII"}, {"FF", "Free Food"}, {"FFBGMPR", "Bomby, Firey, Foldy, Gelatin, Marker, Pie, Ruby", ""}, {"Fies", "Fies", "Fries"}, {"Firey thing", "Firey"}, {"FireyAAA", "Firey"}, {"FireyJr", "Firey Jr."}, {"Fireyjr", "Firey Jr."}, {"FireyLeafy", "Firey and Leafy"}, {"FireyLeafyPen", "Firey, Leafy and Pen", ""}, {"FireyMad", "Firey"}, {"FireyMetal", "Metal Firey", "Firey"}, {"FireyOld", "Firey"}, {"FireySB", "Firey Speaker Box"}, {"FishMonster", "Fish Monster"}, {"FiveEEE", "Five"}, {"Fizzy", "Fizzy", "User:GenericGenerator999"}, {"Flamingo", "AlbertsStuff", "w:c:youtube:Flamingo"}, {"Flour", "Flower"}, {"FlowerAnnouncer", "Flower Speaker Box"}, {"FlowerIcon", "Flower"}, {"FlowerMetal", "Metal Flower", "Flower"}, {"FlowerSB", "Flower Speaker Box"}, {"For", "Four"}, {"four with extra cripple nipple", "Four"}, {"Four's Assets 2nd", "Four"}, {"FourAngry", "Four"}, {"FourBeat", "Four"}, {"FourEE", "Four"}, {"FourEEE", "Four"}, {"FourEugh", "Four"}, {"FourEvil", "Four"}, {"FourFat", "Four"}, {"FourGoodJob", "Four"}, {"FourIntro", "Four"}, {"Fourintro", "Four"}, {"FourKiller", "Four"}, {"FourMeltedAngry", "Four"}, {"FourNextLevelMad", "Four"}, {"FourOMG", "Four "}, {"FourReallyEvilLoudestScreech", "Four"}, {"FourScreech", "Four"}, {"FourShocked", "Four"}, {"FourSoil", "Four"}, {"FourSirPelo", "Four"}, {"FourSrPelo", "Four"}, {"FourSrPeloEEE", "Four"}, {"FourThinking", "Four"}, {"FourUH OH", "Four"}, {"FourX", "Four and X"}, {"Fouryyyyyyyyyyyyy", "Four"}, {"FreeFood", "Free Food"}, {"FreddieFreaker", "Freddie Freaker", "w:c:freddiefreaker:Freddie Freaker"}, {"FriesShock", "Fries"}, {"FS", "Foldy and Stapy", "Foldy/Relationships/Stapy"}, {"FSM", "Foldy, Stapy and Marker", ""}, {"Furrin", "Furrin", "User:RyoTheDragonGuy RBLX"}, {"GamerSponge", "Gamer Spongebob", "User:Lolguy23"}, {"Gamey", "Gamey", "w:c:object-overload:Gamey"}, {"Gatty", "Gaty"}, {"GB", "Golf Ball"}, {"GB8B", "Golf Ball and 8-Ball", ""}, {"GBad", "Golf Ball"}, {"GBPoisoned", "Golf Ball"}, {"GBWut", "Golf Ball"}, {"GelatinHappyToYou", "Gelatin"}, {"GelatinMucinex", "Gelatin"}, {"GelatinTinkle", "Gelatin"}, {"GelatinZappy", "Gelatin"}, {"Gelitan", "Gelatin"}, {"GettingTeardropToTalk", "Getting Teardrop to Talk"}, {"GN", "Gelatin/Relationships#Naily"}, {"Golden globe", "Golden globe", ""}, {"GolfBall", "Golf Ball"}, {"GP", "Gaty and Pillow", ""}, {"GreenMarker", "Green Marker", "User:Green Marker Official"}, {"GreenRocky", "Green Rocky", "Variations of Rocky#Green Rocky"}, {"GSSB", "Green Small Speaker Box"}, {"HELLOKEVIN", "HelloKevin"}, {"HenryS", "Henry Stickmin", "w:c:henrystickmin:Henry Stickmin"}, {"Hex", "Hexlime", ""}, {"HKevin", "HelloKevin"}, {"HSBTSB", "Hexagon Speaker Box and Triangle Speaker Box", ""}, {"HWA HWA HWA. Foo.", "Ruby"}, {"HoverboardEB", "Hoverboard", "User:EdwardBloxy"}, {"IAM", "It's a Monster"}, {"Iancian", "Iance"}, {"IC", "Ice Cube"}, {"ICYBrace", "Bracelety"}, {"Icecube", "Ice Cube"}, {"ICNAO", "Ice Cube"}, {"IcOld", "Ice Cube"}, {"IloveRumania", "IloveRumania", "User:IloveRumania"}, {"IN3", "Insectophobe's Nightmare 3"}, {"ITRD", "Income Tax Return Document"}, {"Jaiden", "Jaiden", "User:Ozarcusmapesae/Jaiden"}, {"JormaT", "Jorma Taccone", "wikipedia:Jorma Taccone"}, {"JubJub", "JubJub Boopkins", "w:c:supermarioglitchy4:JubJub Boopkins"}, {"KingCake", "King Cake", "Variations of Cake#King Cake"}, {"KitchenSink", "Kitchen Sink"}, {"LB", "Lego Brick"}, {"LegoBrick", "Lego Brick"}, {"LeafyandRuby", "Leafy and Ruby", "Leafy/Relationships#Ruby"}, {"LeafyWut", "Leafy"}, {"Leefey", "Leefey", "Leafy"}, {"LightningDigging", "Lightning"}, {"Line", "Liy and Bell", ""}, {"LiyIsDum", "LiyISDumb21", "User:LiyISDumb21"}, {"LiyisDum", "LiyISDumb21", "User:LiyISDumb21"}, {"LiyIsDumb21", "LiyISDumb21", "User:LiyISDumb21"}, {"LNEC", "Leafy, Needle, Eggy and Clock", ""}, {"logueRoboty", "Roboty"}, {"Lollipo", "Lollipop"}, {"LoserBut", "Loser"}, {"LoserLick", "Loser"}, {"LP", "Leafy and Pin"}, {"MarioSMG4", "Mario", "w:c:supermarioglitchy4:Mario"}, {"Mark", "Marker"}, {"MatchBlue", "Blue Match", "Match"}, {"MatchRuby", "Match and Ruby", "Ruby/Relationships#Match"}, {"Me", "Me", "Special:MyPage"}, {"Megan", "Megan", "User:TnT20052013isbackagain"}, {"MeganBFB7", "Megan W.", "Recommended Characters/BFB_7#Megan_W."}, {"MeggyS", "Meggy Spletzer", "w:c:supermarioglitchy4:Meggy Spletzer"}, {"MelonySMG4", "Melony", "w:c:supermarioglitchy4:Melony"}, {"MePhone 4", "MePhone4"}, {"MetalBook", "Metal Book", "Book"}, {"MetaLeafy", "Metal Leafy", "Leafy"}, {"MetalPin", "Metal Pin", "Pin"}, {"MilkCartonEB", "Milk Carton", "User:EdwardBloxy"}, {"MrBeast", "MrBeast6000", "w:c:youtube:MrBeast"}, {"MSDOS3000", "MSDOS3000", "User blog:DoodleYT/tell the ms-dos 3000 some questions"}, {"MS-DOSEB", "MS-DOS Computer", "User:EdwardBloxy"}, {"Multilation", "Mutilation"}, {"Naedle", "Naedle", "Needle"}, {"NateGroth", "Nate Groth"}, {"NewNickel", "Nickel"}, {"NewSaw", "Saw"}, {"NewYoyleBook", "YoyleBook", "User:AnonymousUser the II"}, {"NickelNew", "Nickel"}, {"NickelOrange", "Nickel"}, {"NMS", "No More Snow!"}, {"OctR", "OctRTheEggYolk", "User:OctRTheEggYolk"}, {"OJ", "OJ", "w:c:inanimateinsanity:OJ"}, {"Old3", "Three"}, {"Old4", "Four"}, {"OldFour", "Four"}, {"OldRFlower", "Robot Flower"}, {"OldX", "X"}, {"OneEEE", "One"}, {"OrangeBalloony", "Balloony"}, {"OSS", "SOTP SIGN"}, {"Outlet", "Outlet", "User:Pancaiks&Butter"}, {"PARAPPARULEZ", "PARAPPARULEZ", "User:PARAPPARULEZ"}, {"PandoraBook", "Pandora Book", "Recommended Characters/BFB 4#Pandora Book"}, {"ParkKunPicture", "ParkKun Picture", "User:ChuMan812"}, {"PB", "Puffball"}, {"PBSB", "Puffball Speaker Box"}, {"PCSB", "Purple Round Speaker"}, {"PenCapless","Pen"}, {"PencilHNG", "Pencil"}, {"Pendy", "Pendy", "User:ABetterNameThanThat"}, {"Penhwat", "Pen"}, {"PenIcon", "Pen"}, {"PF", "Purple Face"}, {"Pffbll", "Puffball"}, {"PhatCloudy", "Cloudy"}, {"PieTeamIcon", "Pie"}, {"PillowRunning", "Pillow"}, {"PinWhite", "Pin"}, {"PM", "Pencil/Relationships/Match"}, {"PMP", "Portable Music Player"}, {"Po", "Po", "User blog:DisgustingPepsi2/Po"}, {"Polandball", "Polandball", "w:c:polandball:Polandball"}, {"PriceTag", "Price Tag"}, {"PriceTagEpic", "Price Tag"}, {"PRS", "Purple Round Speaker"}, {"Rainbomb", "ObjectReater", "User:ObjectReater"}, {"RandomWoody", "Woody"}, {"Recording", "Recording", "BFB 8"}, {"Remaker", "TWDremaker2000", "User:TWDremaker2000"}, {"RFlower", "Robot Flower"}, {"RiSct", "BFDISScuti2", "User:BFDISScuti2"}, {"RobotFlower", "Robot Flower"}, {"RockyEvil", "Rocky"}, {"RockyIcon", "Rocky"}, {"RockyOrange", "Rocky"}, {"Rosie", "Rosey", "User:PossiblyKimi"}, {"RS", "Rolling Stone", "User:EdwardBloxy"}, {"RubberDucky", "A duck"}, {"RubberSpatula", "Rubber Spatula"}, {"RubberSpatulaSpeed", "Rubber Spatula"}, {"RubyCry", "Ruby"}, {"RubyHWA", "Ruby"}, {"RubyMetal", "Metal Ruby", "Ruby"}, {"RuinedRuby", "Ruby"}, {"RustyCoin", "Rusty Coin"}, {"ryOfAWeirdSpeakerBox", "Announcer's Diary", "Hidden or brief messages#Announcer.27s Diary:"}, {"RZ45", "REDZONE45", "User:REDZONE45"}, {"SaikoB", "Saiko Bichitaru", "w:c:supermarioglitchy4:Saiko Bichitaru"}, {"SaltLamp", "Salt Lamp"}, {"Sanford", "Sanford", "w:c:madnesscombat:Sanford"}, {"SARS-CoV-2", "SARS-CoV-2", "w:c:bfdia-remade:SARS-CoV-2"}, {"SatisfactionDetector", "Satisfaction Detector"}, {"SawNoHandle", "Saw"}, {"SawOrange","Saw"}, {"SB", "Snowball"}, {"Sball", "Snowball"}, {"SBSB", "Spike Ball Speaker Box"}, {"Scorbunnin", "Scorbunnin", "User:Floofyfurret"}, {"ScribbledEggs", "ScribbledEggs", "User:ScribbledEggs"}, {"SeeingPerson", "Yellow Face"}, {"SevenEEE", "Seven"}, {"ShoppingCart", "Shopping Cart"}, {"Shrek", "Shrek", "w:c:shrek:Shrek (character)"}, {"Shroomy", "Shroomy", "w:c:supermarioglitchy4:Shroomy"}, {"ShroomyDH", "Shroomy", "w:c:supermarioglitchy4:Shroomy"}, {"Sign", "Sign", ""}, {"SixEEE", "Six"}, {"Slapoda", "Slapoda stands", "User:SlapodaRadiation"}, {"Slime", "Tennis Ball"}, {"SmallIC", "Ice Cube"}, {"SMG3", "SuperMarioGlitchy3", "w:c:supermarioglitchy4:SMG3"}, {"SMG4", "SuperMarioGlitchy4", "w:c:supermarioglitchy4:SMG4"}, {"SnareDrum", "Snare Drum"}, {"Snowbubble", "Snowbubble", "User:SaifTheSnobble"}, {"SoftTC", "Soft Tyre Compound", "User:Minardi-LMS"}, {"SotpSign", "SOTP SIGN"}, {"Spongezilla", "Spongezilla", "Recommended Characters/BFB 7#spongezilla"}, {"SpongyDark", "Spongy"}, {"Spongebob", "Spongebob", "w:c:spongebob:SpongeBob SquarePants"}, {"SpongyIcon", "Spongy"}, {"SpongyMetal", "Metal Spongy", "Spongy"}, {"SuperMarioBlock", "mario block", "User:Waffleboi123"}, {"SurpriseEgg", "Surprise Egg", ""}, {"SwordInfinity", "Sword"}, {"Tari", "Tari", "w:c:supermarioglitchy4:Tari"}, {"TB", "Tennis Ball"}, {"TBGB", "Tennis Ball and Golf Ball"}, {"TD", "Teardrop"}, {"Teardr0p", "Teardr0p", "Teardrop"}, {"TennisBall", "Tennis Ball"}, {"ThreeEEE", "Three"}, {"Timemaster", "Timemaster", "User:EdwardBloxy"}, {"TL", "The Losers!"}, {"TLLYC", "The Long-lost Yoyle City"}, {"TooLongDidntListen", "Yellow Face"}, {"TP", "Toilet Paper", "User:StillNotOriginal/OCs"}, {"TreeOld", "Tree"}, {"Treetop", "Teardrop"}, {"TreeV", "Tree"}, {"TriangleSB", "Triangle Speaker Box"}, {"Triggered8Ball", "8-Ball"}, {"Turbocharger", "Turbocharger", "User:Minardi-LMS"}, {"TwoEEE", "Two"}, {"Twomad", "twomad", "w:c:youtube:twomad"}, {"TwoPain", "Two"}, {"Tyler878", "Tyler878", "User:Tyler878"}, {"UltraLeoGX", "UltraLeoGXExpert AUTTP", "User:UltraLeoGXExpert AUTTP"}, {"United States", "The United States of America", "wikipedia:United States"}, {"Unknown", "Unknown", ""}, {"USA", "The United States of America", "wikipedia:United States"}, {"USBAni", "USB", "User:Aaniiball"}, {"VanWoody789", "VanWoody789", "User:VanWoody789"}, {"Violety", "Violety", "User:PossiblyKimi"}, {"VolumeS", "Volume Symbol", "User:EdwardBloxy"}, {"Walten", "Walt Tophat", "User:Walten Paperclips"}, {"WIM", "White Internet Man", "User:EdwardBloxy"}, {"WinToken", "Win Token"}, {"Woody Dab", "Woody"}, {"WoodyAAA", "Woody"}, {"WoodyDab", "Woody"}, {"Woodydab", "Woody"}, {"WoodyDabDab", "Woody"}, {"WoodyOrange", "Woody"}, {"WoodyOrangeDented", "Woody"}, {"X 2", "X"}, {"XAngry", "X"}, {"XBandAided", "X"}, {"XCry", "X"}, {"Xcry", "X"}, {"XEEE", "X"}, {"XFHV 4", "Four"}, {"Example", "Pim"}, {"Xjing", "X"}, {"XKiller", "X"}, {"Xmad", "X"}, {"Xno", "X"}, {"Xreading", "X"}, {"XScared", "X"}, {"XSrPelo", "X"}, {"XThinking", "X"}, {"XUnhappy", "X"}, {"XWorried", "X"}, {"YellowFace", "Yellow Face"}, {"YF", "Yellow Face"}, {"YFFrown", "Yellow Face"}, {"You", "You", "Special:MyPage"}, {"YTPBook", "YTPBook", "User:YTPmachine123"}, {"YWIWK", "Yeah, Who? I Wanna Know"}, {"ZBD", "Zeeky Boogy Doog"}, {"ZZUnknown", "Unknown", ""}, {"ZZunknown", "Unknown", ""}, }

--[[ code

This function returns the corresponding alt text or the link destination for the specified code.

Usage:

Specify the code in the first parameter. If the second parameter is equal to "alt", the function will return the corresponding alt text for the code. Otherwise, the function will return the link destination for the code.

If the code doesn't exist in the codes table (because the filename for the Dia template is exactly equal to the character's name), the code itself is returned, regardless of the second parameter. ]]

function p.code( frame ) c = mw.text.trim(frame.args[1]); for i, a in ipairs(codes) do       if a[1] == c then if not ( frame.args[2] == "alt" or a[3] == nil ) then return a[3]; else return a[2]; end end end return c; end

return p;