Module:Mayor/Elections/doc

This page stores for non-automated election results. This page allows human input for historical data tracing and recording.

Election Database Editing
If you use the tool below to get the data, please pay special attention to the "nil" fields that you might need to replace, and double check on the output UI for safety.

Get Last Election Data Get Current Election Data

"Get Last Election Data" is for getting the results of the last election
 * It should replace the in-progress table for the same year, if exists.
 * The "last" values are grabbed from the in-progress table, if exists - not from the API.

"Get Current Election Data" is for getting the data of an ongoing election
 * The "last" values must be inputted manually, according to what displayed in-game. For candidates without "last elected" shown, this field can be left as "nil".
 * To reduce error, you must check the generated Mayor Election UI with in-game after punching the information!

Format
The order in field 'perks' here will affect tooltip outputs, so please crosscheck the perks with the order listed on Mayor Elections. The field 'order' is the order of candidate listing, from left to right.

Format 1
This is the standard way of record for maximum accuracy: [year] = { date =, data = { Candidate1 = { votes =, perks = , order = , last = }, } },

Click to copy an empty form of this format:  [__] = { date = '__', data = { __ = { votes = __, perks = '__', order = 1, last = __ }, __ = { votes = __, perks = '__', order = 2, last = __ }, __ = { votes = __, perks = '__', order = 3, last = __ }, __ = { votes = __, perks = '__', order = 4, last = __ }, __ = { votes = __, perks = '__', order = 5, last = __ }, }},

Format 2
This is the standard way of record for fair accuracy (if you only know vote result but without initial order and individual perks): [year] = { date =, result = { }, perks = }, The field 'perks' is the winner's perk, if applicable.

Click to copy an empty form of this format:  [__] = { date = '__', result = { __ = __, __ = __, __ = __, __ = __, __ = __ }, perks = '__' },

Format 3
This is the compromised version if data is not enough (if you only know the winner stats): [year] = { date =, mayor = , percent =, votes = , perks = '' }, The fields 'percent', 'votes' and 'perks' are information about the winner, if applicable. The field 'percent' is only needed for this case! Otherwise it can be calculated with each candidate's votes.

Click to copy an empty form of this format:  [__] = { date = '__', mayor = '__', percent = __, votes = __, perks = '__' },

Election UIs Editing
Every 20 elections are recorded on a page named Mayor Election/Events/Year #-#, for example Mayor Election/Events/Year 201-220. The indexes are according to the years that elections started ("Election Year"). Note that a mayor election ends in the following year, when the new mayor is elected.

All elections should be in UIs. If not existing, use Mayor Election UI or Mayor UI for placeholders. These two templates can pull any new data in Module:Mayor/Elections to generate a UI.

Election Starts
During a mayor election, use "Get Current Election Data" to update the database. Then, go to the latest subpage on Mayor Election/Events. Create an election year entry as follows (replace # with the Election Year) (click to copy). Copy the starting page of the Election UI from the game, and paste it under Election. (For higher retaining accuracy, do not use Mayor Election UI for this step unless you cannot provide a direct UI copy.)  Election Year #

Election Result
Ongoing.

Election Ends
After a mayor election, use "Get Last Election Data" to update the database. Then, copy the Mayor UI from the game, and paste it under Election Result. After copying UI, remember to disable the link of the ballot box (use none; none,). (For higher retaining accuracy, do not use Mayor UI for this step unless you cannot provide a direct UI copy.)

Alpha Network
Everything is the same, except the subpages are located on Mayor Election/Alpha instead of /Events.