Module:CurrentNOISZSLEvent/doc

From NOISZ Wiki

This is the documentation page for Module:CurrentNOISZSLEvent

This module is meant to be used with EventCycleTime as an input; that module inputs how many seconds we are into a 10-week event cycle to determine which event is currently running, as it's the same order: LUNATIC MAINFRAME -> Attitude Mint -> Blue Moon -> BLACK CAT BLASTER -> NUCLEAR DRIP. This returns a string that contains all information about the current event, in lieu of a table.

Event Cycle

The countdown timers are all based on the countdown clock extension for Fandom. A typical template for the countdowns looks something like:

{{NOISZ SL Recursive Events|cyclestart=2023-03-15 04:00 +0000}}

Where cyclestart is a variable determining the beginning of a 10-week cycle. The widgets use this 10-week cycle to determine what events are currently running - or rather, how far it is into a 10-week cycle. Synthetic and Recursive events currently run on the same clock. If you look at the NOISZ SL Recursive Events, it may look daunting, but a lot of it is just text operations; the only variable here is the currenly running, event, seen in things such as {{CurrentNoiszSLEvent|cyclestart={{{cyclestart|}}}}}, {{EventCountdown|eventstyle=Nuclear Drip|cyclestart={{{cyclestart|}}}|countdown=True}} and {{EventTimeLeft|cyclestart={{{cyclestart|}}}}}. Note that {{{cyclestart|}}} sets a variable within the template, and whatever goes after the pipe at the end is set as the default for that variable if nothing is entered.

CurrentNoiszSLEvent uses that 10-week cycle to determine what events are running. EventCountdown uses the Countdown widget until a certain mark in that 10-week timer, and EventTimeLeft does the same, but for a mark 2 weeks after that.

If you look at Module:CurrentNOISZSLEvent, it uses a case/switch statement depending on EventCycleTime, which returns how many seconds we are into a 10-week cycle.

EventCycleTime is simply: {{#expr:({{#time:U|now}} -{{#time:U|{{{cyclestart|2023-04-01 04:00 +0000}}}}})mod4838400}} ie, it looks at the time between now and any past date set as the beginning of a cycle, which is defined as the moment Recursive Event 01 goes live. It uses mod4838400 to divide that time elapsed by the total number of seconds in a 10-week cycle, and returns the remainder, which is how many seconds we are.

To recap, it does that, and CurrentNoiszSLEvent uses that time to determine where in a 10-week cycle we are in seconds; if we are less than 1209600 seconds into a cycle, which is two weeks, it determines the currently running Recursive Event is Attitude Mint. If it's more than that, the case switch moves onto the next statement, and so, if we're more than 1209600 seconds but less than 2419200 (4 weeks) in, then the current event is Blue Moon, and so on.