Module:Infobox AFL biography/convert explained

-- [SublimeLinter luacheck-globals:mw]

-- This module serves to convert
-delimited teams/years parameters in-- to their equivalent numbered pairs. Simply-- replace "

Main&Quot; And Press &Quot;Save&Quot;. Local P:local getBuffer, print = require("Module:OutputBuffer")

local function printfd(formatString, ...) local default = ""

local args, argsNum =, select("#", ...) local newArgs = for i = 1, argsNum do if args[i] ~= nil then table.insert(newArgs, args[i]) else table.insert(newArgs, default) end end print(string.format(formatString, unpack(newArgs)))end

local function processTeamsYears(teams, years, gamesGoals, teamsParam, yearsParam, gamesGoalsParam, oldGamesGoalsParam) local function extractItems(s, t) local sentinel = "" -- WTF, Lua? string.gsub(string.gsub(s, "<[Bb][Rr] */?>", " " .. sentinel .. " "), "[^" .. sentinel .. "]+", function(c) table.insert(t, string.match(c, "^%s*(.-)%s*$")) end) end local newTeams = extractItems(teams, newTeams) local newYears = extractItems(years, newYears) local newGamesGoals = extractItems(gamesGoals, newGamesGoals)

if #newTeams ~= #newYears or #newYears ~= #newGamesGoals or #newGamesGoals ~= #newTeams then printfd("") printfd("

%Ss:%s", teamsParam, teams) printfd("
%S:%s", yearsParam, years) printfd("
%S:%s", oldGamesGoalsParam, gamesGoals) return end

c = 1 for i = 1, #newTeams do if newYears[i] ~= "" or newTeams[i] ~= "" then printfd("

%S%S:%s", yearsParam, c, newYears[i] ~= "" and newYears[i] or "") printfd("
%S%S:%s", teamsParam, c, newTeams[i] ~= "" and newTeams[i] or "") printfd("
%S%S:%s", gamesGoalsParam, c, newGamesGoals[i] ~= "" and newGamesGoals[i] or "") c = c + 1 end endend

function p._main(args) print("

Embed:%s", args.embed) end if args.headercolor then printfd("
Header-Color:%s", args.headercolor) end if args.name or args.playername then printfd("
%s", args.name or args.playername) end printfd("
Fullname:%s", args.fullname) end if args.nickname then printfd("
Nickname:%s", args.nickname) end printfd("
Birth Date:%s", args.birth_date) printfd("
Birth Place:%s", args.birth_place) printfd("
Death Date:%s", args.death_date) printfd("
Death Place:%s", args.death_place) if args.originalteam then printfd("
Originalteam:%s", args.originalteam) end if args.draftpick then printfd("
Draftpick:%s", args.draftpick) end if args.debutdate then printfd("
Debutdate:%s", args.debutdate) end if args.debutteam then printfd("
Debutteam:%s", args.debutteam) end if args.debutopponent then printfd("
Debutopponent:%s", args.debutopponent) end if args.debutstadium then printfd("
Debutstadium:%s", args.debutstadium) end printfd("
Heightweight:%s", args.heightweight) printfd("
Position:%s", args.position) if args.otheroccupation then printfd("
Otheroccupation:%s", args.otheroccupation) end if args.currentclub then printfd("
Currentclub:%s", args.currentclub) end if args.guernsey then printfd("
Guernsey:%s", args.guernsey) end if args.statsend then printfd("
Statsend:%s", args.statsend) end if args.coachstatsend then printfd("
Coachstatsend:%s", args.coachstatsend) end if args.repstatsend then printfd("
Repstatsend:%s", args.repstatsend) end if args.playingteams then printfd("
Playingteams:%s", args.playingteams) end if args.coachingteams then printfd("
Coachingteams:%s", args.coachingteams) end if args.clubs and args.years and args.gamesgoals then processTeamsYears(args.clubs, args.years, args.gamesgoals, "club", "years", "games_goals", "games(goals)") elseif args.clubs or args.years or args.gamesgoals then print("") printfd("
Clubs:%s", args.clubs) printfd("
Years:%s", args.years) printfd("
Games(Goals):%s", args.gamesgoals) end if args.club1 then printfd("
Club1:%s", args.club1) end if args.years1 then printfd("
Years1:%s", args.years1) end if args.games_goals1 then printfd("
Games Goals1:%s", args.games_goals1) end if args.club2 then printfd("
Club2:%s", args.club2) end if args.years2 then printfd("
Years2:%s", args.years2) end if args.games_goals2 then printfd("
Games Goals2:%s", args.games_goals2) end if args.club3 then printfd("
Club3:%s", args.club3) end if args.years3 then printfd("
Years3:%s", args.years3) end if args.games_goals3 then printfd("
Games Goals3:%s", args.games_goals3) end if args.club4 then printfd("
Club4:%s", args.club4) end if args.years4 then printfd("
Years4:%s", args.years4) end if args.games_goals4 then printfd("
Games Goals4:%s", args.games_goals4) end if args.club5 then printfd("
Club5:%s", args.club5) end if args.years5 then printfd("
Years5:%s", args.years5) end if args.games_goals5 then printfd("
Games Goals5:%s", args.games_goals5) end if args.club6 then printfd("
Club6:%s", args.club6) end if args.years6 then printfd("
Years6:%s", args.years6) end if args.games_goals6 then printfd("
Games Goals6:%s", args.games_goals6) end if args.club7 then printfd("
Club7:%s", args.club7) end if args.years7 then printfd("
Years7:%s", args.years7) end if args.games_goals7 then printfd("
Games Goals7:%s", args.games_goals7) end if args.club8 then printfd("
Club8:%s", args.club8) end if args.years8 then printfd("
Years8:%s", args.years8) end if args.games_goals8 then printfd("
Games Goals8:%s", args.games_goals8) end if args.club9 then printfd("
Club9:%s", args.club9) end if args.years9 then printfd("
Years9:%s", args.years9) end if args.games_goals9 then printfd("
Games Goals9:%s", args.games_goals9) end if args.club10 then printfd("
Club10:%s", args.club10) end if args.years10 then printfd("
Years10:%s", args.years10) end if args.games_goals10 then printfd("
Games Goals10:%s", args.games_goals10) end if args.gamesgoalstotal then printfd("
Games Goalstotal:%s", args.gamesgoalstotal) end if args.sooteams and args.sooyears and args.soogamesgoals then processTeamsYears(args.sooteams, args.sooyears, args.soogamesgoals, "sooteam", "sooyears", "soogames_goals", "soogames(goals)") elseif args.sooteams or args.sooyears or args.soogamesgoals then print("") printfd("
Sooteams:%s", args.sooteams) printfd("
Sooyears:%s", args.sooyears) printfd("
Soogames(Goals):%s", args.soogamesgoals) end if args.sooteam1 then printfd("
Sooteam1:%s", args.sooteam1) end if args.sooyears1 then printfd("
Sooyears1:%s", args.sooyears1) end if args.soogames_goals1 then printfd("
Soogames Goals1:%s", args.soogames_goals1) end if args.sooteam2 then printfd("
Sooteam2:%s", args.sooteam2) end if args.sooyears2 then printfd("
Sooyears2:%s", args.sooyears2) end if args.soogames_goals2 then printfd("
Soogames Goals2:%s", args.soogames_goals2) end if args.sooteam3 then printfd("
Sooteam3:%s", args.sooteam3) end if args.sooyears3 then printfd("
Sooyears3:%s", args.sooyears3) end if args.soogames_goals3 then printfd("
Soogames Goals3:%s", args.soogames_goals3) end if args.sooteam4 then printfd("
Sooteam4:%s", args.sooteam4) end if args.sooyears4 then printfd("
Sooyears4:%s", args.sooyears4) end if args.soogames_goals4 then printfd("
Soogames Goals4:%s", args.soogames_goals4) end if args.sooteam5 then printfd("
Sooteam5:%s", args.sooteam5) end if args.sooyears5 then printfd("
Sooyears5:%s", args.sooyears5) end if args.soogames_goals5 then printfd("
Soogames Goals5:%s", args.soogames_goals5) end if args.sooteam6 then printfd("
Sooteam6:%s", args.sooteam6) end if args.sooyears6 then printfd("
Sooyears6:%s", args.sooyears6) end if args.soogames_goals6 then printfd("
Soogames Goals6:%s", args.soogames_goals6) end if args.sooteam7 then printfd("
Sooteam7:%s", args.sooteam7) end if args.sooyears7 then printfd("
Sooyears7:%s", args.sooyears7) end if args.soogames_goals7 then printfd("
Soogames Goals7:%s", args.soogames_goals7) end if args.sooteam8 then printfd("
Sooteam8:%s", args.sooteam8) end if args.sooyears8 then printfd("
Sooyears8:%s", args.sooyears8) end if args.soogames_goals8 then printfd("
Soogames Goals8:%s", args.soogames_goals8) end if args.sooteam9 then printfd("
Sooteam9:%s", args.sooteam9) end if args.sooyears9 then printfd("
Sooyears9:%s", args.sooyears9) end if args.soogames_goals9 then printfd("
Soogames Goals9:%s", args.soogames_goals9) end if args.sooteam10 then printfd("
Sooteam10:%s", args.sooteam10) end if args.sooyears10 then printfd("
Sooyears10:%s", args.sooyears10) end if args.soogames_goals10 then printfd("
Soogames Goals10:%s", args.soogames_goals10) end if args.soogamesgoalstotal then printfd("
Soogames Goalstotal:%s", args.soogamesgoalstotal) end if args.nationalteams and args.nationalyears and args.nationalgamesgoals then processTeamsYears(args.nationalteams, args.nationalyears, args.nationalgamesgoals, "nationalteam", "nationalyears", "nationalgames_goals", "nationalgames(goals)") elseif args.nationalteams or args.nationalyears or args.nationalgamesgoals then print("") printfd("
Nationalteams:%s", args.nationalteams) printfd("
Nationalyears:%s", args.nationalyears) printfd("
Nationalgames(Goals):%s", args.nationalgamesgoals) end if args.nationalteam1 then printfd("
Nationalteam1:%s", args.nationalteam1) end if args.nationalyears1 then printfd("
Nationalyears1:%s", args.nationalyears1) end if args.nationalgames_goals1 then printfd("
Nationalgames Goals1:%s", args.nationalgames_goals1) end if args.nationalteam2 then printfd("
Nationalteam2:%s", args.nationalteam2) end if args.nationalyears2 then printfd("
Nationalyears2:%s", args.nationalyears2) end if args.nationalgames_goals2 then printfd("
Nationalgames Goals2:%s", args.nationalgames_goals2) end if args.nationalteam3 then printfd("
Nationalteam3:%s", args.nationalteam3) end if args.nationalyears3 then printfd("
Nationalyears3:%s", args.nationalyears3) end if args.nationalgames_goals3 then printfd("
Nationalgames Goals3:%s", args.nationalgames_goals3) end if args.nationalteam4 then printfd("
Nationalteam4:%s", args.nationalteam4) end if args.nationalyears4 then printfd("
Nationalyears4:%s", args.nationalyears4) end if args.nationalgames_goals4 then printfd("
Nationalgames Goals4:%s", args.nationalgames_goals4) end if args.nationalteam5 then printfd("
Nationalteam5:%s", args.nationalteam5) end if args.nationalyears5 then printfd("
Nationalyears5:%s", args.nationalyears5) end if args.nationalgames_goals5 then printfd("
Nationalgames Goals5:%s", args.nationalgames_goals5) end if args.nationalteam6 then printfd("
Nationalteam6:%s", args.nationalteam6) end if args.nationalyears6 then printfd("
Nationalyears6:%s", args.nationalyears6) end if args.nationalgames_goals6 then printfd("
Nationalgames Goals6:%s", args.nationalgames_goals6) end if args.nationalteam7 then printfd("
Nationalteam7:%s", args.nationalteam7) end if args.nationalyears7 then printfd("
Nationalyears7:%s", args.nationalyears7) end if args.nationalgames_goals7 then printfd("
Nationalgames Goals7:%s", args.nationalgames_goals7) end if args.nationalteam8 then printfd("
Nationalteam8:%s", args.nationalteam8) end if args.nationalyears8 then printfd("
Nationalyears8:%s", args.nationalyears8) end if args.nationalgames_goals8 then printfd("
Nationalgames Goals8:%s", args.nationalgames_goals8) end if args.nationalteam9 then printfd("
Nationalteam9:%s", args.nationalteam9) end if args.nationalyears9 then printfd("
Nationalyears9:%s", args.nationalyears9) end if args.nationalgames_goals9 then printfd("
Nationalgames Goals9:%s", args.nationalgames_goals9) end if args.nationalteam10 then printfd("
Nationalteam10:%s", args.nationalteam10) end if args.nationalyears10 then printfd("
Nationalyears10:%s", args.nationalyears10) end if args.nationalgames_goals10 then printfd("
Nationalgames Goals10:%s", args.nationalgames_goals10) end if args.nationalgamesgoalstotal then printfd("
Nationalgames Goalstotal:%s", args.nationalgamesgoalstotal) end if args.coachclubs and args.coachyears and args.coachgameswins then processTeamsYears(args.coachclubs, args.coachyears, args.coachgameswins, "coachclub", "coachyears", "coachgames_wins", "coachgames(wins)") elseif args.coachclubs or args.coachyears or args.coachgameswins then print("") printfd("
Coachclubs:%s", args.coachclubs) printfd("
Coachyears:%s", args.coachyears) printfd("
Coachgames(Wins):%s", args.coachgameswins) end if args.coachteam1 then printfd("
Coachteam1:%s", args.coachteam1) end if args.coachyears1 then printfd("
Coachyears1:%s", args.coachyears1) end if args.coachgames_goals1 then printfd("
Coachgames Goals1:%s", args.coachgames_goals1) end if args.coachteam2 then printfd("
Coachteam2:%s", args.coachteam2) end if args.coachyears2 then printfd("
Coachyears2:%s", args.coachyears2) end if args.coachgames_goals2 then printfd("
Coachgames Goals2:%s", args.coachgames_goals2) end if args.coachteam3 then printfd("
Coachteam3:%s", args.coachteam3) end if args.coachyears3 then printfd("
Coachyears3:%s", args.coachyears3) end if args.coachgames_goals3 then printfd("
Coachgames Goals3:%s", args.coachgames_goals3) end if args.coachteam4 then printfd("
Coachteam4:%s", args.coachteam4) end if args.coachyears4 then printfd("
Coachyears4:%s", args.coachyears4) end if args.coachgames_goals4 then printfd("
Coachgames Goals4:%s", args.coachgames_goals4) end if args.coachteam5 then printfd("
Coachteam5:%s", args.coachteam5) end if args.coachyears5 then printfd("
Coachyears5:%s", args.coachyears5) end if args.coachgames_goals5 then printfd("
Coachgames Goals5:%s", args.coachgames_goals5) end if args.coachteam6 then printfd("
Coachteam6:%s", args.coachteam6) end if args.coachyears6 then printfd("
Coachyears6:%s", args.coachyears6) end if args.coachgames_goals6 then printfd("
Coachgames Goals6:%s", args.coachgames_goals6) end if args.coachteam7 then printfd("
Coachteam7:%s", args.coachteam7) end if args.coachyears7 then printfd("
Coachyears7:%s", args.coachyears7) end if args.coachgames_goals7 then printfd("
Coachgames Goals7:%s", args.coachgames_goals7) end if args.coachteam8 then printfd("
Coachteam8:%s", args.coachteam8) end if args.coachyears8 then printfd("
Coachyears8:%s", args.coachyears8) end if args.coachgames_goals8 then printfd("
Coachgames Goals8:%s", args.coachgames_goals8) end if args.coachteam9 then printfd("
Coachteam9:%s", args.coachteam9) end if args.coachyears9 then printfd("
Coachyears9:%s", args.coachyears9) end if args.coachgames_goals9 then printfd("
Coachgames Goals9:%s", args.coachgames_goals9) end if args.coachteam10 then printfd("
Coachteam10:%s", args.coachteam10) end if args.coachyears10 then printfd("
Coachyears10:%s", args.coachyears10) end if args.coachgames_goals10 then printfd("
Coachgames Goals10:%s", args.coachgames_goals10) end if args.coachgameswinstotal then printfd("
Coachgames Winstotal:%s", args.coachgameswinstotal) end if args.umpireyears1 then printfd("
Umpireyears1:%s", args.umpireyears1) end if args.umpireleague1 then printfd("
Umpireleague1:%s", args.umpireleague1) end if args.umpirerole1 then printfd("
Umpirerole1:%s", args.umpirerole1) end if args.umpiregames1 then printfd("
Umpiregames1:%s", args.umpiregames1) end if args.umpireyears2 then printfd("
Umpireyears2:%s", args.umpireyears2) end if args.umpireleague2 then printfd("
Umpireleague2:%s", args.umpireleague2) end if args.umpirerole2 then printfd("
Umpirerole2:%s", args.umpirerole2) end if args.umpiregames2 then printfd("
Umpiregames2:%s", args.umpiregames2) end if args.umpireyears3 then printfd("
Umpireyears3:%s", args.umpireyears3) end if args.umpireleague3 then printfd("
Umpireleague3:%s", args.umpireleague3) end if args.umpirerole3 then printfd("
Umpirerole3:%s", args.umpirerole3) end if args.umpiregames3 then printfd("
Umpiregames3:%s", args.umpiregames3) end if args.umpireyears4 then printfd("
Umpireyears4:%s", args.umpireyears4) end if args.umpireleague4 then printfd("
Umpireleague4:%s", args.umpireleague4) end if args.umpirerole4 then printfd("
Umpirerole4:%s", args.umpirerole4) end if args.umpiregames4 then printfd("
Umpiregames4:%s", args.umpiregames4) end if args.umpireyears5 then printfd("
Umpireyears5:%s", args.umpireyears5) end if args.umpireleague5 then printfd("
Umpireleague5:%s", args.umpireleague5) end if args.umpirerole5 then printfd("
Umpirerole5:%s", args.umpirerole5) end if args.umpiregames5 then printfd("
Umpiregames5:%s", args.umpiregames5) end printfd("
Careerhighlights:%s", args.careerhighlights) print("

")

return getBuffer("\n")end

function p.main(frame) local args = require("Module:Arguments").getArgs(frame) return p._main(args)end

return p