Exports

Exports

The script provides the following exports for integration with other resources:

  • SetWeather(weather, region): Set the weather (optionally for a specific region).

  • GetCurrentWeather(region): Get the current weather (optionally for a specific region).

  • TriggerBlackout(): Trigger a blackout.

  • ClearBlackout(): Clear an active blackout.

  • TriggerExtremeEvent(event): Trigger an extreme weather event.

  • ClearExtremeEvent(): Clear an active extreme weather event.

  • EnableWeatherSync(): Enable weather synchronization.

  • DisableWeatherSync(): Disable weather synchronization.

  • EnableTimeSync(): Enable time synchronization.

  • DisableTimeSync(): Disable time synchronization.

Example: Setting Weather

exports.b2_weatherEssentials:SetWeather('EXTRASUNNY')

For regional weather:

exports.b2_weatherEssentials:SetWeather('EXTRASUNNY', 'City')

Example: Getting Current Weather

For regional weather:

Example: Controlling Blackouts

Example: Triggering Extreme Weather Events

Example: Enabling/Disabling Sync

Last updated