Module:Antarctic Union: Difference between revisions

From EarthMC
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(22 intermediate revisions by 2 users not shown)
Line 1: Line 1:
local p = {} --p stands for package
local p = {} --p stands for package, dont edit this variable
local ministers = {"Dools2", "DS_Devil", "Lv4x", "DS_Devil", "j3nkn3r", "Ushkaa", "MagicSkyboi12"}
 
local cabinet = "4th"
--                    PM,      DPM,    Economy,  For.Affairs,    Army, Infrastructure, Events        Internal Affairs
local cabinetName = "1st Dools2 Cabinet"
local ministers = {"twomoo1119", "gorkymoo1119", "Gris_", "gorkymoo1119", "Spawned_Eagle", "Yokogiri", "MagicZel", "Thee_Boss"}
local since = "October 17, 2023"
local cabinet = "5th"
local cabinetName = "1st twomoo1119 Cabinet"
local since = "6 March 2024"
 
local assemblyMember = 42
 
--Member Counts for: Ind., ADP, UAP, CLAU, TGA, PRP
local parties = {0, 0, 0, 0, 0, 0}


function p.minister( frame )
function p.minister( frame )
Line 21: Line 28:
     elseif arg == "events" then
     elseif arg == "events" then
         return ministers[7]
         return ministers[7]
    elseif arg == "internal" then
        return ministers[8]
     end
     end
     return "error "..arg
     return "error "..arg
Line 28: Line 37:
     local arg = frame.args[1]
     local arg = frame.args[1]
     if arg == "pm" then
     if arg == "pm" then
         return "{{PlayerIMG|"..ministers[1].."|full||245px}}"
         return frame:preprocess("{{PlayerIMG|"..ministers[1].."|full||245px}}")
     elseif arg == "dpm" then
     elseif arg == "dpm" then
         return "{{PlayerIMG|"..ministers[2].."|full||245px}}"
         return frame:preprocess("{{PlayerIMG|"..ministers[2].."|full||245px}}")
     elseif arg == "economy" then
     elseif arg == "economy" then
         return "{{PlayerIMG|"..ministers[3].."|full||245px}}"
         return frame:preprocess("{{PlayerIMG|"..ministers[3].."|full||245px}}")
     elseif arg == "foreign" then
     elseif arg == "foreign" then
         return "{{PlayerIMG|"..ministers[4].."|full||245px}}"
         return frame:preprocess("{{PlayerIMG|"..ministers[4].."|full||245px}}")
     elseif arg == "army" then
     elseif arg == "army" then
         return "{{PlayerIMG|"..ministers[5].."|full||245px}}"
         return frame:preprocess("{{PlayerIMG|"..ministers[5].."|full||245px}}")
     elseif arg == "infrastructure" then
     elseif arg == "infrastructure" then
         return "{{PlayerIMG|"..ministers[6].."|full||245px}}"
         return frame:preprocess("{{PlayerIMG|"..ministers[6].."|full||245px}}")
     elseif arg == "events" then
     elseif arg == "events" then
         return "{{PlayerIMG|"..ministers[7].."|full||245px}}"
         return frame:preprocess("{{PlayerIMG|"..ministers[7].."|full||245px}}")
     end
     end
     return "error "..arg
     return "error "..arg
Line 68: Line 77:
     local arg = frame.args[1]
     local arg = frame.args[1]
     if arg == "pm" then
     if arg == "pm" then
         return frame:preprocess("{{PlayerIMG|"..ministers[1].."|small}} [[Aurora:"..ministers[1].."|"..ministers[1].."]]")
         return frame:preprocess("{{PlayerIMG|"..ministers[1].."|small}} [["..ministers[1].."]]")
     elseif arg == "dpm" then
     elseif arg == "dpm" then
         return frame:preprocess("{{PlayerIMG|"..ministers[2].."|small}} [[Aurora:"..ministers[2].."|"..ministers[2].."]]")
         return frame:preprocess("{{PlayerIMG|"..ministers[2].."|small}} [["..ministers[2].."]]")
     elseif arg == "economy" then
     elseif arg == "economy" then
         return frame:preprocess("{{PlayerIMG|"..ministers[3].."|small}} [[Aurora:"..ministers[3].."|"..ministers[3].."]]")
         return frame:preprocess("{{PlayerIMG|"..ministers[3].."|small}} [["..ministers[3].."]]")
     elseif arg == "foreign" then
     elseif arg == "foreign" then
         return frame:preprocess("{{PlayerIMG|"..ministers[4].."|small}} [[Aurora:"..ministers[4].."|"..ministers[4].."]]")
         return frame:preprocess("{{PlayerIMG|"..ministers[4].."|small}} [["..ministers[4].."]]")
     elseif arg == "army" then
     elseif arg == "army" then
         return frame:preprocess("{{PlayerIMG|"..ministers[5].."|small}} [[Aurora:"..ministers[5].."|"..ministers[5].."]]")
         return frame:preprocess("{{PlayerIMG|"..ministers[5].."|small}} [["..ministers[5].."]]")
     elseif arg == "infrastructure" then
     elseif arg == "infrastructure" then
         return frame:preprocess("{{PlayerIMG|"..ministers[6].."|small}} [[Aurora:"..ministers[6].."|"..ministers[6].."]]")
         return frame:preprocess("{{PlayerIMG|"..ministers[6].."|small}} [["..ministers[6].."]]")
     elseif arg == "events" then
     elseif arg == "events" then
         return frame:preprocess("{{PlayerIMG|"..ministers[7].."|small}} [[Aurora:"..ministers[7].."|"..ministers[7].."]]")
         return frame:preprocess("{{PlayerIMG|"..ministers[7].."|small}} [["..ministers[7].."]]")
     end
     end
     return frame:preprocess("{{PlayerIMG|Fix|small}} error "..arg)
     return frame:preprocess("{{PlayerIMG|Fix|small}} error "..arg)
Line 97: Line 106:
end
end


function p.assemblyCount( frame )
    return assemblyMember
end
function p.partyMember( frame )
    local arg = tonumber(frame.args[1])
    return parties[arg]
end
function p.partyPercentage( frame )
    local arg = tonumber(frame.args[1])
    local percentage = parties[arg]/assemblyMember
    return percentage*100
end
function p.partyPercentageBox( frame )
    local arg1 = tonumber(frame.args[1])
    local arg2 = frame.args[2]
    return frame:preprocess("{{PercentageBox|"..arg2.."|{{#invoke:Antarctic Union|partyPercentage|"..arg1.."}}%|{{#invoke:Antarctic Union|partyMember|"..arg1.."}}/{{#invoke:Antarctic Union|assemblyCount}}}}")
end


return p
return p

Latest revision as of 21:28, 6 March 2024

This is module is to edit every page ASAP without manually editing all. I did this module because I was bored manually editing every AU page.


local p = {} --p stands for package, dont edit this variable

--                    PM,       DPM,     Economy,   For.Affairs,     Army, Infrastructure, Events        Internal Affairs
local ministers = {"twomoo1119", "gorkymoo1119", "Gris_", "gorkymoo1119", "Spawned_Eagle", "Yokogiri", "MagicZel", "Thee_Boss"}
local cabinet = "5th"
local cabinetName = "1st twomoo1119 Cabinet"
local since = "6 March 2024"

local assemblyMember = 42

--Member Counts for: Ind., ADP, UAP, CLAU, TGA, PRP
local parties = {0, 0, 0, 0, 0, 0}

function p.minister( frame )
    local arg = frame.args[1]
    if arg == "pm" then
        return ministers[1]
    elseif arg == "dpm" then
        return ministers[2]
    elseif arg == "economy" then
        return ministers[3]
    elseif arg == "foreign" then
        return ministers[4]
    elseif arg == "army" then
        return ministers[5]
    elseif arg == "infrastructure" then
        return ministers[6]
    elseif arg == "events" then
        return ministers[7]
    elseif arg == "internal" then
        return ministers[8]
    end
    return "error "..arg
end

function p.ministerIMG( frame )
    local arg = frame.args[1]
    if arg == "pm" then
        return frame:preprocess("{{PlayerIMG|"..ministers[1].."|full||245px}}")
    elseif arg == "dpm" then
        return frame:preprocess("{{PlayerIMG|"..ministers[2].."|full||245px}}")
    elseif arg == "economy" then
        return frame:preprocess("{{PlayerIMG|"..ministers[3].."|full||245px}}")
    elseif arg == "foreign" then
        return frame:preprocess("{{PlayerIMG|"..ministers[4].."|full||245px}}")
    elseif arg == "army" then
        return frame:preprocess("{{PlayerIMG|"..ministers[5].."|full||245px}}")
    elseif arg == "infrastructure" then
        return frame:preprocess("{{PlayerIMG|"..ministers[6].."|full||245px}}")
    elseif arg == "events" then
        return frame:preprocess("{{PlayerIMG|"..ministers[7].."|full||245px}}")
    end
    return "error "..arg
end

function p.ministerlink( frame )
    local arg = frame.args[1]
    if arg == "pm" then
        return "[[Aurora:"..ministers[1].."|"..ministers[1].."]]"
    elseif arg == "dpm" then
        return "[[Aurora:"..ministers[2].."|"..ministers[2].."]]"
    elseif arg == "economy" then
        return "[[Aurora:"..ministers[3].."|"..ministers[3].."]]"
    elseif arg == "foreign" then
        return "[[Aurora:"..ministers[4].."|"..ministers[4].."]]"
    elseif arg == "army" then
        return "[[Aurora:"..ministers[5].."|"..ministers[5].."]]"
    elseif arg == "infrastructure" then
        return "[[Aurora:"..ministers[6].."|"..ministers[6].."]]"
    elseif arg == "events" then
        return "[[Aurora:"..ministers[7].."|"..ministers[7].."]]"
    end
    return "error "..arg
end

function p.ministerlinkimage( frame )
    local arg = frame.args[1]
    if arg == "pm" then
        return frame:preprocess("{{PlayerIMG|"..ministers[1].."|small}} [["..ministers[1].."]]")
    elseif arg == "dpm" then
        return frame:preprocess("{{PlayerIMG|"..ministers[2].."|small}} [["..ministers[2].."]]")
    elseif arg == "economy" then
        return frame:preprocess("{{PlayerIMG|"..ministers[3].."|small}} [["..ministers[3].."]]")
    elseif arg == "foreign" then
        return frame:preprocess("{{PlayerIMG|"..ministers[4].."|small}} [["..ministers[4].."]]")
    elseif arg == "army" then
        return frame:preprocess("{{PlayerIMG|"..ministers[5].."|small}} [["..ministers[5].."]]")
    elseif arg == "infrastructure" then
        return frame:preprocess("{{PlayerIMG|"..ministers[6].."|small}} [["..ministers[6].."]]")
    elseif arg == "events" then
        return frame:preprocess("{{PlayerIMG|"..ministers[7].."|small}} [["..ministers[7].."]]")
    end
    return frame:preprocess("{{PlayerIMG|Fix|small}} error "..arg)
end

function p.cabinet( frame )
    return cabinet
end

function p.cabinetName( frame )
    return cabinetName
end

function p.since( frame )
    return since
end

function p.assemblyCount( frame )
    return assemblyMember
end

function p.partyMember( frame )
    local arg = tonumber(frame.args[1])
    return parties[arg]
end

function p.partyPercentage( frame )
    local arg = tonumber(frame.args[1])
    local percentage = parties[arg]/assemblyMember
    return percentage*100
end

function p.partyPercentageBox( frame )
    local arg1 = tonumber(frame.args[1])
    local arg2 = frame.args[2]
    return frame:preprocess("{{PercentageBox|"..arg2.."|{{#invoke:Antarctic Union|partyPercentage|"..arg1.."}}%|{{#invoke:Antarctic Union|partyMember|"..arg1.."}}/{{#invoke:Antarctic Union|assemblyCount}}}}")
end

return p