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

local weather = exports.b2_weatherEssentials:GetCurrentWeather()

For regional weather:

local cityWeather = exports.b2_weatherEssentials:GetCurrentWeather('City')

Example: Controlling Blackouts

exports.b2_weatherEssentials:TriggerBlackout()
exports.b2_weatherEssentials:ClearBlackout()

Example: Triggering Extreme Weather Events

exports.b2_weatherEssentials:TriggerExtremeEvent('STORM')
exports.b2_weatherEssentials:ClearExtremeEvent()

Example: Enabling/Disabling Sync

exports.b2_weatherEssentials:EnableWeatherSync()
exports.b2_weatherEssentials:DisableWeatherSync()
exports.b2_weatherEssentials:EnableTimeSync()
exports.b2_weatherEssentials:DisableTimeSync()

Last updated