Module:Autocat

local AC = {}

local alignmentData = mw.loadData( 'Module:Autocat/Alignments' )

local hairData = mw.loadData( 'Module:Autocat/Hair' )

local eyeData = mw.loadData( 'Module:Autocat/Eyes' )

function AC.username(frame) local iusername = frame.args[1] or frame.args["iusername"] test = frame.args["test"] if test == "" then if string.lower(iusername) == "npc" or iusername == "" then ousername = "" else ousername = "" ousername2 = "Owned by "..iusername.."" end end return ousername, ousername2 end

function AC.age(frame) local iage = frame.args[1] or frame.args["iage"] local oage = string.match( iage, "%d?%d%d") test = frame.args["test"] if test == "" then oage2 = "" oage3 = " "..iage.."" end return oage2, oage3 end

function AC.sexuality(frame) local isexuality = frame.args[1] or frame.args["isexuality"] local osexuality = string.lower(isexuality) test = frame.args["test"] if test == "" then osexuality2 = sexualitytData[osexuality] or sexualitytData["#default"] or "" osexuality3 = isexuality end return osexuality2, osexuality3 end

function AC.element(frame) local ielement = frame.args[1] or frame.args["ielement"] test = frame.args["test"] if test == "" then oelement = string.match( string.lower(ielement), "air") if oelement == "air" then oelement2 = "" oelement3 = " Airbender" end oelement = string.match( string.lower(ielement), "earth") if oelement == "earth" then oelement2 = "" oelement3 = " Earthbender" end oelement = string.match( string.lower(ielement), "fire") if oelement == "fire" then oelement2 = "" oelement3 = " Firebender" end oelement = string.match( string.lower(ielement), "non") if oelement == "non" then oelement2 = "" oelement3 = " Nonbender" end oelement = string.match( string.lower(ielement), "water") if oelement == "water" then oelement2 = "" oelement3 = " Waterbender" end end return oelement2, oelement3 end

function AC.height(frame) local iheight = frame.args[1] or frame.args["iheight"] local oheight = string.match( iheight, "%d'?%d") local oheight2 = string.match( oheight, "^%d") local oheight3 = string.match( oheight, "%d$") test = frame.args["test"] if test == "" then oheight4 = "" end return oheight4 end

function AC.alignment(frame) local ialignment = frame.args[1] or frame.args["ialignment"] local oalignment = string.lower(ialignment) test = frame.args["test"] if test == "" then oalignment2 = alignmentData[oalignment] or "" oalignment3 = "" end if not (oalignment3 == "[[Category:]]") then return oalignment3 end end

function AC.hair(frame) local ihair = frame.args[1] or frame.args["ihair"] local ohair = string.lower(ihair) test = frame.args["test"] if test == "" then ohair2 = hairData[ohair] or "" ohair3 = "" end if not (ohair3 == "[[Category:]]") then return ohair3 end end

function AC.eyes(frame) local ieyes = frame.args[1] or frame.args["ieyes"] local oeyes = string.lower(ieyes) test = frame.args["test"] if test == "" then oeyes2 = hairData[oeyes] or "" oeyes3 = "" end if not (oeyes3 == "[[Category:]]") then return oeyes3 end end

return AC --